2
0
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:
Vladimir Prus
2003-01-21 07:16:58 +00:00
parent 9d5915ad08
commit bdcd91b76d
10 changed files with 172 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
exe hello : main.cpp hello_world_widget.ui : <uses>qt ;

View 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

View 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>

View 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();
}

View 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 ;