diff options
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/debug_class.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/debug_class.h | 20 | ||||
-rw-r--r-- | Tests/QtAutogen/debug_class.ui | 45 | ||||
-rw-r--r-- | Tests/QtAutogen/debug_resource.qrc | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/main.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/resourcetester.cpp | 4 |
7 files changed, 99 insertions, 1 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index d2116aa..3973653 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -64,9 +64,15 @@ add_custom_command( DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" ) +message("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") +if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_TYPES) + set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>) + add_definitions(-DTEST_DEBUG_CLASS) +endif() + add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> - test.qrc second_resource.qrc resourcetester.cpp generated.cpp + test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs} ) set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") diff --git a/Tests/QtAutogen/debug_class.cpp b/Tests/QtAutogen/debug_class.cpp new file mode 100644 index 0000000..58e72e4 --- /dev/null +++ b/Tests/QtAutogen/debug_class.cpp @@ -0,0 +1,9 @@ + +#include "debug_class.h" +#include "ui_debug_class.h" + +DebugClass::DebugClass(QWidget *parent) + : QWidget(parent), ui(new Ui::DebugClass) +{ + ui->setupUi(this); +} diff --git a/Tests/QtAutogen/debug_class.h b/Tests/QtAutogen/debug_class.h new file mode 100644 index 0000000..71bc104 --- /dev/null +++ b/Tests/QtAutogen/debug_class.h @@ -0,0 +1,20 @@ + +#include <QWidget> + +namespace Ui +{ +class DebugClass; +} + +class DebugClass : public QWidget +{ + Q_OBJECT +public: + explicit DebugClass(QWidget *parent = 0); + +signals: + void someSignal(); + +private: + Ui::DebugClass *ui; +}; diff --git a/Tests/QtAutogen/debug_class.ui b/Tests/QtAutogen/debug_class.ui new file mode 100644 index 0000000..dc2e1ac --- /dev/null +++ b/Tests/QtAutogen/debug_class.ui @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DebugClass</class> + <widget class="QWidget" name="DebugClass"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>DebugClass</string> + </property> + <widget class="QCheckBox" name="checkBox"> + <property name="geometry"> + <rect> + <x>50</x> + <y>20</y> + <width>82</width> + <height>21</height> + </rect> + </property> + <property name="text"> + <string>CheckBox</string> + </property> + </widget> + <widget class="QPushButton" name="pushButton"> + <property name="geometry"> + <rect> + <x>40</x> + <y>70</y> + <width>94</width> + <height>24</height> + </rect> + </property> + <property name="text"> + <string>PushButton</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/debug_resource.qrc b/Tests/QtAutogen/debug_resource.qrc new file mode 100644 index 0000000..db98b9b --- /dev/null +++ b/Tests/QtAutogen/debug_resource.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>debug_class.ui</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/main.cpp index c8a036e..eb59665 100644 --- a/Tests/QtAutogen/main.cpp +++ b/Tests/QtAutogen/main.cpp @@ -51,6 +51,11 @@ #include "yaf.h" #include "libC.h" #include "resourcetester.h" +#ifdef TEST_DEBUG_CLASS +#include "debug_class.h" +#include <iostream> +#endif + int main(int argv, char **args) { @@ -81,5 +86,9 @@ int main(int argv, char **args) QTimer::singleShot(0, &rt, SLOT(doTest())); +#ifdef TEST_DEBUG_CLASS + std::cout << DebugClass::staticMetaObject.className() << std::endl; +#endif + return app.exec(); } diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/resourcetester.cpp index 0c64d80..043ec75 100644 --- a/Tests/QtAutogen/resourcetester.cpp +++ b/Tests/QtAutogen/resourcetester.cpp @@ -18,6 +18,10 @@ void ResourceTester::doTest() qApp->exit(EXIT_FAILURE); if (!QFile::exists(":/main.cpp")) qApp->exit(EXIT_FAILURE); +#ifdef TEST_DEBUG_CLASS + if (!QFile::exists(":/debug_class.ui")) + qApp->exit(EXIT_FAILURE); +#endif QTimer::singleShot(0, qApp, SLOT(quit())); } |