Skip to content

Commit fca3535

Browse files
author
Alexis Lopez Zubieta
committed
Add QtWidgetsApplication
1 parent bbab99e commit fca3535

File tree

8 files changed

+130
-1
lines changed

8 files changed

+130
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Desktop Entry]
2+
Name=QtWidgetsApplication
3+
Type=Application
4+
Exec=QtWidgetsApplication
5+
TryExec=QtWidgetsApplication
6+
Icon=QtWidgetsApplication
7+
Categories=Development;
18.5 KB
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#-------------------------------------------------
2+
#
3+
# Project created by QtCreator 2017-02-19T11:50:17
4+
#
5+
#-------------------------------------------------
6+
7+
QT += core gui
8+
9+
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
10+
11+
TARGET = QtWidgetsApplication
12+
TEMPLATE = app
13+
14+
# The following define makes your compiler emit warnings if you use
15+
# any feature of Qt which as been marked as deprecated (the exact warnings
16+
# depend on your compiler). Please consult the documentation of the
17+
# deprecated API in order to know how to port your code away from it.
18+
DEFINES += QT_DEPRECATED_WARNINGS
19+
20+
# You can also make your code fail to compile if you use deprecated APIs.
21+
# In order to do so, uncomment the following line.
22+
# You can also select to disable deprecated APIs only up to a certain version of Qt.
23+
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
24+
25+
26+
SOURCES += main.cpp\
27+
mainwindow.cpp
28+
29+
HEADERS += mainwindow.h
30+
31+
FORMS += mainwindow.ui
32+
33+
target.path = $$PREFIX/bin
34+
icon.path = $$PREFIX/share/icons/hicolor/512x512
35+
icon.files = QtWidgetsApplication.png
36+
37+
desktop_entry.path = $$PREFIX/share/applications
38+
desktop_entry.files = QtWidgetsApplication.desktop
39+
INSTALLS += target icon desktop_entry

QtWidgetsApplication/main.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include "mainwindow.h"
2+
#include <QApplication>
3+
4+
int main(int argc, char *argv[])
5+
{
6+
QApplication a(argc, argv);
7+
MainWindow w;
8+
w.show();
9+
10+
return a.exec();
11+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "mainwindow.h"
2+
#include "ui_mainwindow.h"
3+
4+
MainWindow::MainWindow(QWidget *parent) :
5+
QMainWindow(parent),
6+
ui(new Ui::MainWindow)
7+
{
8+
ui->setupUi(this);
9+
}
10+
11+
MainWindow::~MainWindow()
12+
{
13+
delete ui;
14+
}

QtWidgetsApplication/mainwindow.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef MAINWINDOW_H
2+
#define MAINWINDOW_H
3+
4+
#include <QMainWindow>
5+
6+
namespace Ui {
7+
class MainWindow;
8+
}
9+
10+
class MainWindow : public QMainWindow
11+
{
12+
Q_OBJECT
13+
14+
public:
15+
explicit MainWindow(QWidget *parent = 0);
16+
~MainWindow();
17+
18+
private:
19+
Ui::MainWindow *ui;
20+
};
21+
22+
#endif // MAINWINDOW_H

QtWidgetsApplication/mainwindow.ui

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<ui version="4.0">
2+
<class>MainWindow</class>
3+
<widget class="QMainWindow" name="MainWindow" >
4+
<property name="geometry" >
5+
<rect>
6+
<x>0</x>
7+
<y>0</y>
8+
<width>400</width>
9+
<height>300</height>
10+
</rect>
11+
</property>
12+
<property name="windowTitle" >
13+
<string>MainWindow</string>
14+
</property>
15+
<widget class="QMenuBar" name="menuBar" />
16+
<widget class="QToolBar" name="mainToolBar" />
17+
<widget class="QWidget" name="centralWidget" />
18+
<widget class="QStatusBar" name="statusBar" />
19+
</widget>
20+
<layoutDefault spacing="6" margin="11" />
21+
<pixmapfunction></pixmapfunction>
22+
<resources/>
23+
<connections/>
24+
</ui>

build_appimages.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ build_appimage() {
2828
mv -v *AppImage ${BASE_DIR}/out || return 1
2929
}
3030

31-
## Build projects
31+
### Build projects
3232
pushd QtQuickControls2Application
3333
# This env variable is used by the qt plugin to search the qml sources in other paths than the AppDir
3434
# it's mandatory to use when your qml files are embed as Qt resources into the main binary.
@@ -58,3 +58,15 @@ pushd QtWebEngineApplication
5858
build_appimage QtWebEngineApplication ${PWD}/AppDir || exit 1
5959
popd
6060
popd
61+
62+
pushd QtWidgetsApplication
63+
export QML_SOURCES_PATHS="${PWD}"
64+
65+
mkdir build
66+
pushd build
67+
qmake CONFIG+=release PREFIX=/usr ../QtWidgetsApplication.pro || exit 1
68+
INSTALL_ROOT=${PWD}/AppDir make install || exit 1
69+
70+
build_appimage QtWidgetsApplication ${PWD}/AppDir || exit 1
71+
popd
72+
popd

0 commit comments

Comments
 (0)