From 540d08f4858ddbb8d0356f77f878b9fbb7af8f80 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Sat, 9 Dec 2017 13:50:12 +0100 Subject: Autogen: Tests: Move QtAutoUicInterface test to QtAutogen/UicInterface --- Tests/CMakeLists.txt | 41 ------------ Tests/QtAutoUicInterface/CMakeLists.txt | 76 ----------------------- Tests/QtAutoUicInterface/klocalizedstring.cpp | 12 ---- Tests/QtAutoUicInterface/klocalizedstring.h | 17 ----- Tests/QtAutoUicInterface/libwidget.cpp | 14 ----- Tests/QtAutoUicInterface/libwidget.h | 25 -------- Tests/QtAutoUicInterface/libwidget.ui | 32 ---------- Tests/QtAutoUicInterface/main.cpp | 67 -------------------- Tests/QtAutoUicInterface/mywidget.cpp | 14 ----- Tests/QtAutoUicInterface/mywidget.h | 25 -------- Tests/QtAutoUicInterface/mywidget.ui | 32 ---------- Tests/QtAutogen/CommonTests.cmake | 1 + Tests/QtAutogen/UicInterface/CMakeLists.txt | 58 +++++++++++++++++ Tests/QtAutogen/UicInterface/klocalizedstring.cpp | 12 ++++ Tests/QtAutogen/UicInterface/klocalizedstring.h | 17 +++++ Tests/QtAutogen/UicInterface/libwidget.cpp | 14 +++++ Tests/QtAutogen/UicInterface/libwidget.h | 25 ++++++++ Tests/QtAutogen/UicInterface/libwidget.ui | 32 ++++++++++ Tests/QtAutogen/UicInterface/main.cpp | 67 ++++++++++++++++++++ Tests/QtAutogen/UicInterface/mywidget.cpp | 14 +++++ Tests/QtAutogen/UicInterface/mywidget.h | 25 ++++++++ Tests/QtAutogen/UicInterface/mywidget.ui | 32 ++++++++++ 22 files changed, 297 insertions(+), 355 deletions(-) delete mode 100644 Tests/QtAutoUicInterface/CMakeLists.txt delete mode 100644 Tests/QtAutoUicInterface/klocalizedstring.cpp delete mode 100644 Tests/QtAutoUicInterface/klocalizedstring.h delete mode 100644 Tests/QtAutoUicInterface/libwidget.cpp delete mode 100644 Tests/QtAutoUicInterface/libwidget.h delete mode 100644 Tests/QtAutoUicInterface/libwidget.ui delete mode 100644 Tests/QtAutoUicInterface/main.cpp delete mode 100644 Tests/QtAutoUicInterface/mywidget.cpp delete mode 100644 Tests/QtAutoUicInterface/mywidget.h delete mode 100644 Tests/QtAutoUicInterface/mywidget.ui create mode 100644 Tests/QtAutogen/UicInterface/CMakeLists.txt create mode 100644 Tests/QtAutogen/UicInterface/klocalizedstring.cpp create mode 100644 Tests/QtAutogen/UicInterface/klocalizedstring.h create mode 100644 Tests/QtAutogen/UicInterface/libwidget.cpp create mode 100644 Tests/QtAutogen/UicInterface/libwidget.h create mode 100644 Tests/QtAutogen/UicInterface/libwidget.ui create mode 100644 Tests/QtAutogen/UicInterface/main.cpp create mode 100644 Tests/QtAutogen/UicInterface/mywidget.cpp create mode 100644 Tests/QtAutogen/UicInterface/mywidget.h create mode 100644 Tests/QtAutogen/UicInterface/mywidget.ui diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 46dc224..5d8c2fe 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1242,18 +1242,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt") - # On Windows there is no RPATH, so while Qt might be available for building, - # the required dlls may not be in the PATH, so we can't run the executables - # on that platform. - if(WIN32) - set(run_autouic_test ${CMAKE_CTEST_COMMAND} -V) - else() - set(run_autouic_test QtAutoUicInterface) - endif() - if(NOT CMAKE_CONFIGURATION_TYPES) - set(QtAutogen_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$) - endif() - if(NOT DEFINED CMake_TEST_Qt5) set(CMake_TEST_Qt5 1) endif() @@ -1262,39 +1250,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND) add_subdirectory(Qt5Autogen) - - add_test(Qt5AutoUicInterface ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface" - "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface" - ${build_generator_args} - --build-project QtAutoUicInterface - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5 - --test-command ${run_autouic_test} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface") endif() if(QT4_WORKS AND QT_QTGUI_FOUND) add_subdirectory(Qt4Autogen) - add_test(Qt4AutoUicInterface ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface" - "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface" - ${build_generator_args} - --build-project QtAutoUicInterface - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - -DQT_TEST_VERSION=4 - --test-command ${run_autouic_test} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface") - add_test(Qt4Targets ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Qt4Targets" diff --git a/Tests/QtAutoUicInterface/CMakeLists.txt b/Tests/QtAutoUicInterface/CMakeLists.txt deleted file mode 100644 index a5c2d99..0000000 --- a/Tests/QtAutoUicInterface/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ - -cmake_minimum_required(VERSION 3.7) - -project(QtAutoUicInterface) - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - - include(UseQt4) - - set(QT_CORE_TARGET Qt4::QtCore) - set(QT_GUI_TARGET Qt4::QtGui) -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - find_package(Qt5Widgets REQUIRED) - - set(QT_CORE_TARGET Qt5::Core) - set(QT_GUI_TARGET Qt5::Widgets) -endif() - -set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) - -# BEGIN Upstream - -set(CMAKE_VERBOSE_MAKEFILE ON) - -add_library(KI18n klocalizedstring.cpp) -target_link_libraries(KI18n ${QT_CORE_TARGET}) - -set(autouic_options - -tr tr2$<$>>:x>i18n -) -if (NOT Qt5Widgets_VERSION VERSION_LESS 5.3.0) - list(APPEND autouic_options -include klocalizedstring.h) -endif() - -set_property(TARGET KI18n APPEND PROPERTY - INTERFACE_AUTOUIC_OPTIONS ${autouic_options} -) - -set(domainProp $) -set(nameLower $>>) -set(domain_logic - $<$:${domainProp}>$<$>:${nameLower}> -) -set_property(TARGET KI18n APPEND PROPERTY - INTERFACE_COMPILE_DEFINITIONS "TRANSLATION_DOMAIN=${domain_logic}" -) - -# END upstream - -get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(_GENERATOR_IS_MULTI_CONFIG) -set(INC_DIR "include_$" ) -else() -set(INC_DIR "include" ) -endif() - -add_library(LibWidget libwidget.cpp) -target_link_libraries(LibWidget KI18n ${QT_GUI_TARGET}) -set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON) -set_property(TARGET LibWidget PROPERTY TRANSLATION_DOMAIN customdomain) - -add_library(MyWidget mywidget.cpp) -target_link_libraries(MyWidget KI18n ${QT_GUI_TARGET}) - -add_executable(QtAutoUicInterface main.cpp) -target_compile_definitions(QtAutoUicInterface - PRIVATE - UI_LIBWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/LibWidget_autogen/${INC_DIR}/ui_libwidget.h" - UI_MYWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/MyWidget_autogen/${INC_DIR}/ui_mywidget.h" -) diff --git a/Tests/QtAutoUicInterface/klocalizedstring.cpp b/Tests/QtAutoUicInterface/klocalizedstring.cpp deleted file mode 100644 index b629cd1..0000000 --- a/Tests/QtAutoUicInterface/klocalizedstring.cpp +++ /dev/null @@ -1,12 +0,0 @@ - -#include "klocalizedstring.h" - -QString tr2xi18n(const char* text, const char*) -{ - return QLatin1String("TranslatedX") + QString::fromLatin1(text); -} - -QString tr2i18n(const char* text, const char*) -{ - return QLatin1String("Translated") + QString::fromLatin1(text); -} diff --git a/Tests/QtAutoUicInterface/klocalizedstring.h b/Tests/QtAutoUicInterface/klocalizedstring.h deleted file mode 100644 index 6129599..0000000 --- a/Tests/QtAutoUicInterface/klocalizedstring.h +++ /dev/null @@ -1,17 +0,0 @@ - -#ifndef KLOCALIZEDSTRING_H -#define KLOCALIZEDSTRING_H - -#include - -#ifdef _WIN32 -__declspec(dllexport) -#endif - QString tr2xi18n(const char* text, const char* comment = 0); - -#ifdef _WIN32 -__declspec(dllexport) -#endif - QString tr2i18n(const char* text, const char* comment = 0); - -#endif diff --git a/Tests/QtAutoUicInterface/libwidget.cpp b/Tests/QtAutoUicInterface/libwidget.cpp deleted file mode 100644 index 008c22a..0000000 --- a/Tests/QtAutoUicInterface/libwidget.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "libwidget.h" - -LibWidget::LibWidget(QWidget* parent) - : QWidget(parent) - , ui(new Ui::LibWidget) -{ - ui->setupUi(this); -} - -LibWidget::~LibWidget() -{ - delete ui; -} diff --git a/Tests/QtAutoUicInterface/libwidget.h b/Tests/QtAutoUicInterface/libwidget.h deleted file mode 100644 index b6f3e82..0000000 --- a/Tests/QtAutoUicInterface/libwidget.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef LIBWIDGET_H -#define LIBWIDGET_H - -#include -#include - -#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) -#include -#endif - -#include "ui_libwidget.h" - -class LibWidget : public QWidget -{ - Q_OBJECT -public: - explicit LibWidget(QWidget* parent = 0); - ~LibWidget(); - -private: - Ui::LibWidget* ui; -}; - -#endif diff --git a/Tests/QtAutoUicInterface/libwidget.ui b/Tests/QtAutoUicInterface/libwidget.ui deleted file mode 100644 index 897371e..0000000 --- a/Tests/QtAutoUicInterface/libwidget.ui +++ /dev/null @@ -1,32 +0,0 @@ - - - LibWidget - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - 180 - 60 - 57 - 15 - - - - LibLabel - - - - - - diff --git a/Tests/QtAutoUicInterface/main.cpp b/Tests/QtAutoUicInterface/main.cpp deleted file mode 100644 index 68bd843..0000000 --- a/Tests/QtAutoUicInterface/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ - -#include -#include -#include - -int main(int argc, char** argv) -{ - std::ifstream f; - f.open(UI_LIBWIDGET_H); - if (!f.is_open()) { - std::cout << "Could not open \"" UI_LIBWIDGET_H "\"." << std::endl; - return -1; - } - - { - bool gotTr2i18n = false; - - while (!f.eof()) { - std::string output; - getline(f, output); - if (!gotTr2i18n) { - gotTr2i18n = output.find("tr2i18n") != std::string::npos; - } - if (output.find("tr2xi18n") != std::string::npos) { - std::cout << "ui_libwidget,h uses tr2xi18n, though it should not." - << std::endl; - return -1; - } - } - - if (!gotTr2i18n) { - std::cout << "Did not find tr2i18n in ui_libwidget.h" << std::endl; - return -1; - } - } - - f.close(); - f.open(UI_MYWIDGET_H); - if (!f.is_open()) { - std::cout << "Could not open \"" UI_MYWIDGET_H "\"." << std::endl; - return -1; - } - - { - bool gotTr2xi18n = false; - - while (!f.eof()) { - std::string output; - getline(f, output); - if (!gotTr2xi18n) { - gotTr2xi18n = output.find("tr2xi18n") != std::string::npos; - } - if (output.find("tr2i18n") != std::string::npos) { - std::cout << "ui_mywidget,h uses tr2i18n, though it should not." - << std::endl; - return -1; - } - } - if (!gotTr2xi18n) { - std::cout << "Did not find tr2xi18n in ui_mywidget.h" << std::endl; - return -1; - } - } - f.close(); - - return 0; -} diff --git a/Tests/QtAutoUicInterface/mywidget.cpp b/Tests/QtAutoUicInterface/mywidget.cpp deleted file mode 100644 index 7cf1a13..0000000 --- a/Tests/QtAutoUicInterface/mywidget.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "mywidget.h" - -MyWidget::MyWidget(QWidget* parent) - : QWidget(parent) - , ui(new Ui::MyWidget) -{ - ui->setupUi(this); -} - -MyWidget::~MyWidget() -{ - delete ui; -} diff --git a/Tests/QtAutoUicInterface/mywidget.h b/Tests/QtAutoUicInterface/mywidget.h deleted file mode 100644 index c23e55d..0000000 --- a/Tests/QtAutoUicInterface/mywidget.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef MYWIDGET_H -#define MYWIDGET_H - -#include -#include - -#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) -#include -#endif - -#include "ui_mywidget.h" - -class MyWidget : public QWidget -{ - Q_OBJECT -public: - explicit MyWidget(QWidget* parent = 0); - ~MyWidget(); - -private: - Ui::MyWidget* ui; -}; - -#endif diff --git a/Tests/QtAutoUicInterface/mywidget.ui b/Tests/QtAutoUicInterface/mywidget.ui deleted file mode 100644 index b2b9cc5..0000000 --- a/Tests/QtAutoUicInterface/mywidget.ui +++ /dev/null @@ -1,32 +0,0 @@ - - - MyWidget - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - 110 - 40 - 81 - 23 - - - - Special button - - - - - - diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 5746ab5..c56780e 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -24,6 +24,7 @@ if(QT_TEST_ALLOW_QT_MACROS) ADD_AUTOGEN_TEST(MocCMP0071) endif() ADD_AUTOGEN_TEST(UicInclude uicInclude) +ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface) ADD_AUTOGEN_TEST(ObjectLibrary someProgram) if(APPLE AND (NOT QT_TEST_VERSION STREQUAL 4)) ADD_AUTOGEN_TEST(MacOsFW) diff --git a/Tests/QtAutogen/UicInterface/CMakeLists.txt b/Tests/QtAutogen/UicInterface/CMakeLists.txt new file mode 100644 index 0000000..a216aff --- /dev/null +++ b/Tests/QtAutogen/UicInterface/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.10) +project(UicInterface) +include("../AutogenTest.cmake") + +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +# BEGIN Upstream + +set(CMAKE_VERBOSE_MAKEFILE ON) + +add_library(KI18n klocalizedstring.cpp) +target_link_libraries(KI18n ${QT_QTCORE_TARGET}) + +set(autouic_options + -tr tr2$<$>>:x>i18n +) +if (NOT Qt5Widgets_VERSION VERSION_LESS 5.3.0) + list(APPEND autouic_options -include klocalizedstring.h) +endif() + +set_property(TARGET KI18n APPEND PROPERTY + INTERFACE_AUTOUIC_OPTIONS ${autouic_options} +) + +set(domainProp $) +set(nameLower $>>) +set(domain_logic + $<$:${domainProp}>$<$>:${nameLower}> +) +set_property(TARGET KI18n APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "TRANSLATION_DOMAIN=${domain_logic}" +) + +# END upstream + +get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(_GENERATOR_IS_MULTI_CONFIG) +set(INC_DIR "include_$" ) +else() +set(INC_DIR "include" ) +endif() + +add_library(LibWidget libwidget.cpp) +target_link_libraries(LibWidget KI18n ${QT_QTGUI_TARGET}) +set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON) +set_property(TARGET LibWidget PROPERTY TRANSLATION_DOMAIN customdomain) + +add_library(MyWidget mywidget.cpp) +target_link_libraries(MyWidget KI18n ${QT_QTGUI_TARGET}) + +add_executable(QtAutoUicInterface main.cpp) +target_compile_definitions(QtAutoUicInterface + PRIVATE + UI_LIBWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/LibWidget_autogen/${INC_DIR}/ui_libwidget.h" + UI_MYWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/MyWidget_autogen/${INC_DIR}/ui_mywidget.h" +) diff --git a/Tests/QtAutogen/UicInterface/klocalizedstring.cpp b/Tests/QtAutogen/UicInterface/klocalizedstring.cpp new file mode 100644 index 0000000..b629cd1 --- /dev/null +++ b/Tests/QtAutogen/UicInterface/klocalizedstring.cpp @@ -0,0 +1,12 @@ + +#include "klocalizedstring.h" + +QString tr2xi18n(const char* text, const char*) +{ + return QLatin1String("TranslatedX") + QString::fromLatin1(text); +} + +QString tr2i18n(const char* text, const char*) +{ + return QLatin1String("Translated") + QString::fromLatin1(text); +} diff --git a/Tests/QtAutogen/UicInterface/klocalizedstring.h b/Tests/QtAutogen/UicInterface/klocalizedstring.h new file mode 100644 index 0000000..6129599 --- /dev/null +++ b/Tests/QtAutogen/UicInterface/klocalizedstring.h @@ -0,0 +1,17 @@ + +#ifndef KLOCALIZEDSTRING_H +#define KLOCALIZEDSTRING_H + +#include + +#ifdef _WIN32 +__declspec(dllexport) +#endif + QString tr2xi18n(const char* text, const char* comment = 0); + +#ifdef _WIN32 +__declspec(dllexport) +#endif + QString tr2i18n(const char* text, const char* comment = 0); + +#endif diff --git a/Tests/QtAutogen/UicInterface/libwidget.cpp b/Tests/QtAutogen/UicInterface/libwidget.cpp new file mode 100644 index 0000000..008c22a --- /dev/null +++ b/Tests/QtAutogen/UicInterface/libwidget.cpp @@ -0,0 +1,14 @@ + +#include "libwidget.h" + +LibWidget::LibWidget(QWidget* parent) + : QWidget(parent) + , ui(new Ui::LibWidget) +{ + ui->setupUi(this); +} + +LibWidget::~LibWidget() +{ + delete ui; +} diff --git a/Tests/QtAutogen/UicInterface/libwidget.h b/Tests/QtAutogen/UicInterface/libwidget.h new file mode 100644 index 0000000..b6f3e82 --- /dev/null +++ b/Tests/QtAutogen/UicInterface/libwidget.h @@ -0,0 +1,25 @@ + +#ifndef LIBWIDGET_H +#define LIBWIDGET_H + +#include +#include + +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) +#include +#endif + +#include "ui_libwidget.h" + +class LibWidget : public QWidget +{ + Q_OBJECT +public: + explicit LibWidget(QWidget* parent = 0); + ~LibWidget(); + +private: + Ui::LibWidget* ui; +}; + +#endif diff --git a/Tests/QtAutogen/UicInterface/libwidget.ui b/Tests/QtAutogen/UicInterface/libwidget.ui new file mode 100644 index 0000000..897371e --- /dev/null +++ b/Tests/QtAutogen/UicInterface/libwidget.ui @@ -0,0 +1,32 @@ + + + LibWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 180 + 60 + 57 + 15 + + + + LibLabel + + + + + + diff --git a/Tests/QtAutogen/UicInterface/main.cpp b/Tests/QtAutogen/UicInterface/main.cpp new file mode 100644 index 0000000..68bd843 --- /dev/null +++ b/Tests/QtAutogen/UicInterface/main.cpp @@ -0,0 +1,67 @@ + +#include +#include +#include + +int main(int argc, char** argv) +{ + std::ifstream f; + f.open(UI_LIBWIDGET_H); + if (!f.is_open()) { + std::cout << "Could not open \"" UI_LIBWIDGET_H "\"." << std::endl; + return -1; + } + + { + bool gotTr2i18n = false; + + while (!f.eof()) { + std::string output; + getline(f, output); + if (!gotTr2i18n) { + gotTr2i18n = output.find("tr2i18n") != std::string::npos; + } + if (output.find("tr2xi18n") != std::string::npos) { + std::cout << "ui_libwidget,h uses tr2xi18n, though it should not." + << std::endl; + return -1; + } + } + + if (!gotTr2i18n) { + std::cout << "Did not find tr2i18n in ui_libwidget.h" << std::endl; + return -1; + } + } + + f.close(); + f.open(UI_MYWIDGET_H); + if (!f.is_open()) { + std::cout << "Could not open \"" UI_MYWIDGET_H "\"." << std::endl; + return -1; + } + + { + bool gotTr2xi18n = false; + + while (!f.eof()) { + std::string output; + getline(f, output); + if (!gotTr2xi18n) { + gotTr2xi18n = output.find("tr2xi18n") != std::string::npos; + } + if (output.find("tr2i18n") != std::string::npos) { + std::cout << "ui_mywidget,h uses tr2i18n, though it should not." + << std::endl; + return -1; + } + } + if (!gotTr2xi18n) { + std::cout << "Did not find tr2xi18n in ui_mywidget.h" << std::endl; + return -1; + } + } + f.close(); + + return 0; +} diff --git a/Tests/QtAutogen/UicInterface/mywidget.cpp b/Tests/QtAutogen/UicInterface/mywidget.cpp new file mode 100644 index 0000000..7cf1a13 --- /dev/null +++ b/Tests/QtAutogen/UicInterface/mywidget.cpp @@ -0,0 +1,14 @@ + +#include "mywidget.h" + +MyWidget::MyWidget(QWidget* parent) + : QWidget(parent) + , ui(new Ui::MyWidget) +{ + ui->setupUi(this); +} + +MyWidget::~MyWidget() +{ + delete ui; +} diff --git a/Tests/QtAutogen/UicInterface/mywidget.h b/Tests/QtAutogen/UicInterface/mywidget.h new file mode 100644 index 0000000..c23e55d --- /dev/null +++ b/Tests/QtAutogen/UicInterface/mywidget.h @@ -0,0 +1,25 @@ + +#ifndef MYWIDGET_H +#define MYWIDGET_H + +#include +#include + +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) +#include +#endif + +#include "ui_mywidget.h" + +class MyWidget : public QWidget +{ + Q_OBJECT +public: + explicit MyWidget(QWidget* parent = 0); + ~MyWidget(); + +private: + Ui::MyWidget* ui; +}; + +#endif diff --git a/Tests/QtAutogen/UicInterface/mywidget.ui b/Tests/QtAutogen/UicInterface/mywidget.ui new file mode 100644 index 0000000..b2b9cc5 --- /dev/null +++ b/Tests/QtAutogen/UicInterface/mywidget.ui @@ -0,0 +1,32 @@ + + + MyWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 110 + 40 + 81 + 23 + + + + Special button + + + + + + -- cgit v0.12