mirror of
https://github.com/boostorg/build.git
synced 2026-02-13 12:22:17 +00:00
Add QT/UI example, provided by Felix E. Klee.
[SVN r16969]
This commit is contained in:
2
examples-v2/qt-ui/Jamfile
Normal file
2
examples-v2/qt-ui/Jamfile
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
exe hello : main.cpp hello_world_widget.ui : <uses>qt ;
|
||||
6
examples-v2/qt-ui/hello_world.pro
Normal file
6
examples-v2/qt-ui/hello_world.pro
Normal file
@@ -0,0 +1,6 @@
|
||||
TEMPLATE = app
|
||||
TARGET = helloworld
|
||||
CONFIG += qt warn_on debug
|
||||
SOURCES += main.cpp
|
||||
FORMS = hello_world_widget.ui
|
||||
OBJECTS_DIR = foo
|
||||
55
examples-v2/qt-ui/hello_world_widget.ui
Normal file
55
examples-v2/qt-ui/hello_world_widget.ui
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
|
||||
<class>HelloWorldWidget</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>HelloWorldWidget</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>124</width>
|
||||
<height>63</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Hello World!</string>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>TextLabel2</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>11</x>
|
||||
<y>11</y>
|
||||
<width>102</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hello World!</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>OkButton</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
13
examples-v2/qt-ui/main.cpp
Normal file
13
examples-v2/qt-ui/main.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "hello_world_widget.h"
|
||||
#include <qapplication.h>
|
||||
|
||||
#include <qpushbutton.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
QApplication a(argc, argv);
|
||||
HelloWorldWidget w;
|
||||
QObject::connect(static_cast<QObject*>(w.OkButton), SIGNAL(clicked()), &w, SLOT(close()));
|
||||
a.setMainWidget(&w);
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
10
examples-v2/qt-ui/project-root.jam
Normal file
10
examples-v2/qt-ui/project-root.jam
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
import gcc ;
|
||||
import toolset ;
|
||||
|
||||
# Tell that QT should be used. QTDIR will give installation
|
||||
# prefix.
|
||||
toolset.using qt ;
|
||||
|
||||
#Alternatively, the prefix can be given as second argument
|
||||
#toolset.using qt : /usr/share/qt ;
|
||||
Reference in New Issue
Block a user