From bdcd91b76d902dc8c7e11de5386761baee98ce92 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 21 Jan 2003 07:16:58 +0000 Subject: [PATCH] Add QT/UI example, provided by Felix E. Klee. [SVN r16969] --- example/qt-ui/Jamfile | 2 + example/qt-ui/hello_world.pro | 6 +++ example/qt-ui/hello_world_widget.ui | 55 +++++++++++++++++++++++++ example/qt-ui/main.cpp | 13 ++++++ example/qt-ui/project-root.jam | 10 +++++ examples-v2/qt-ui/Jamfile | 2 + examples-v2/qt-ui/hello_world.pro | 6 +++ examples-v2/qt-ui/hello_world_widget.ui | 55 +++++++++++++++++++++++++ examples-v2/qt-ui/main.cpp | 13 ++++++ examples-v2/qt-ui/project-root.jam | 10 +++++ 10 files changed, 172 insertions(+) create mode 100644 example/qt-ui/Jamfile create mode 100644 example/qt-ui/hello_world.pro create mode 100644 example/qt-ui/hello_world_widget.ui create mode 100644 example/qt-ui/main.cpp create mode 100644 example/qt-ui/project-root.jam create mode 100644 examples-v2/qt-ui/Jamfile create mode 100644 examples-v2/qt-ui/hello_world.pro create mode 100644 examples-v2/qt-ui/hello_world_widget.ui create mode 100644 examples-v2/qt-ui/main.cpp create mode 100644 examples-v2/qt-ui/project-root.jam diff --git a/example/qt-ui/Jamfile b/example/qt-ui/Jamfile new file mode 100644 index 000000000..c1846aaaf --- /dev/null +++ b/example/qt-ui/Jamfile @@ -0,0 +1,2 @@ + +exe hello : main.cpp hello_world_widget.ui : qt ; \ No newline at end of file diff --git a/example/qt-ui/hello_world.pro b/example/qt-ui/hello_world.pro new file mode 100644 index 000000000..6b6891e7e --- /dev/null +++ b/example/qt-ui/hello_world.pro @@ -0,0 +1,6 @@ +TEMPLATE = app +TARGET = helloworld +CONFIG += qt warn_on debug +SOURCES += main.cpp +FORMS = hello_world_widget.ui +OBJECTS_DIR = foo diff --git a/example/qt-ui/hello_world_widget.ui b/example/qt-ui/hello_world_widget.ui new file mode 100644 index 000000000..c9c97a084 --- /dev/null +++ b/example/qt-ui/hello_world_widget.ui @@ -0,0 +1,55 @@ + +HelloWorldWidget + + + HelloWorldWidget + + + + 0 + 0 + 124 + 63 + + + + Hello World! + + + + TextLabel2 + + + + 11 + 11 + 102 + 16 + + + + Hello World! + + + AlignCenter + + + + + OkButton + + + + 10 + 40 + 101 + 21 + + + + OK + + + + + diff --git a/example/qt-ui/main.cpp b/example/qt-ui/main.cpp new file mode 100644 index 000000000..c455b36e5 --- /dev/null +++ b/example/qt-ui/main.cpp @@ -0,0 +1,13 @@ +#include "hello_world_widget.h" +#include + +#include + +int main(int argc, char **argv) { + QApplication a(argc, argv); + HelloWorldWidget w; + QObject::connect(static_cast(w.OkButton), SIGNAL(clicked()), &w, SLOT(close())); + a.setMainWidget(&w); + w.show(); + return a.exec(); +} diff --git a/example/qt-ui/project-root.jam b/example/qt-ui/project-root.jam new file mode 100644 index 000000000..82d9c7c1b --- /dev/null +++ b/example/qt-ui/project-root.jam @@ -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 ; \ No newline at end of file diff --git a/examples-v2/qt-ui/Jamfile b/examples-v2/qt-ui/Jamfile new file mode 100644 index 000000000..c1846aaaf --- /dev/null +++ b/examples-v2/qt-ui/Jamfile @@ -0,0 +1,2 @@ + +exe hello : main.cpp hello_world_widget.ui : qt ; \ No newline at end of file diff --git a/examples-v2/qt-ui/hello_world.pro b/examples-v2/qt-ui/hello_world.pro new file mode 100644 index 000000000..6b6891e7e --- /dev/null +++ b/examples-v2/qt-ui/hello_world.pro @@ -0,0 +1,6 @@ +TEMPLATE = app +TARGET = helloworld +CONFIG += qt warn_on debug +SOURCES += main.cpp +FORMS = hello_world_widget.ui +OBJECTS_DIR = foo diff --git a/examples-v2/qt-ui/hello_world_widget.ui b/examples-v2/qt-ui/hello_world_widget.ui new file mode 100644 index 000000000..c9c97a084 --- /dev/null +++ b/examples-v2/qt-ui/hello_world_widget.ui @@ -0,0 +1,55 @@ + +HelloWorldWidget + + + HelloWorldWidget + + + + 0 + 0 + 124 + 63 + + + + Hello World! + + + + TextLabel2 + + + + 11 + 11 + 102 + 16 + + + + Hello World! + + + AlignCenter + + + + + OkButton + + + + 10 + 40 + 101 + 21 + + + + OK + + + + + diff --git a/examples-v2/qt-ui/main.cpp b/examples-v2/qt-ui/main.cpp new file mode 100644 index 000000000..c455b36e5 --- /dev/null +++ b/examples-v2/qt-ui/main.cpp @@ -0,0 +1,13 @@ +#include "hello_world_widget.h" +#include + +#include + +int main(int argc, char **argv) { + QApplication a(argc, argv); + HelloWorldWidget w; + QObject::connect(static_cast(w.OkButton), SIGNAL(clicked()), &w, SLOT(close())); + a.setMainWidget(&w); + w.show(); + return a.exec(); +} diff --git a/examples-v2/qt-ui/project-root.jam b/examples-v2/qt-ui/project-root.jam new file mode 100644 index 000000000..82d9c7c1b --- /dev/null +++ b/examples-v2/qt-ui/project-root.jam @@ -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 ; \ No newline at end of file