summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutoUicInterface
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-12-09 12:50:12 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-12-13 12:50:19 (GMT)
commit540d08f4858ddbb8d0356f77f878b9fbb7af8f80 (patch)
tree3cb07d93312fd31e754675c4c11260606be79a00 /Tests/QtAutoUicInterface
parentb1504f9f97849777f4690565f8b5879372e7dd51 (diff)
downloadCMake-540d08f4858ddbb8d0356f77f878b9fbb7af8f80.zip
CMake-540d08f4858ddbb8d0356f77f878b9fbb7af8f80.tar.gz
CMake-540d08f4858ddbb8d0356f77f878b9fbb7af8f80.tar.bz2
Autogen: Tests: Move QtAutoUicInterface test to QtAutogen/UicInterface
Diffstat (limited to 'Tests/QtAutoUicInterface')
-rw-r--r--Tests/QtAutoUicInterface/CMakeLists.txt76
-rw-r--r--Tests/QtAutoUicInterface/klocalizedstring.cpp12
-rw-r--r--Tests/QtAutoUicInterface/klocalizedstring.h17
-rw-r--r--Tests/QtAutoUicInterface/libwidget.cpp14
-rw-r--r--Tests/QtAutoUicInterface/libwidget.h25
-rw-r--r--Tests/QtAutoUicInterface/libwidget.ui32
-rw-r--r--Tests/QtAutoUicInterface/main.cpp67
-rw-r--r--Tests/QtAutoUicInterface/mywidget.cpp14
-rw-r--r--Tests/QtAutoUicInterface/mywidget.h25
-rw-r--r--Tests/QtAutoUicInterface/mywidget.ui32
10 files changed, 0 insertions, 314 deletions
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$<$<NOT:$<BOOL:$<TARGET_PROPERTY:NO_KUIT_SEMANTIC>>>: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 $<TARGET_PROPERTY:TRANSLATION_DOMAIN>)
-set(nameLower $<LOWER_CASE:$<MAKE_C_IDENTIFIER:$<TARGET_PROPERTY:NAME>>>)
-set(domain_logic
- $<$<BOOL:${domainProp}>:${domainProp}>$<$<NOT:$<BOOL:${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_$<CONFIG>" )
-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 <QString>
-
-#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 <QWidget>
-#include <memory>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
-#include <klocalizedstring.h>
-#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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>LibWidget</class>
- <widget class="QWidget" name="LibWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <widget class="QLabel" name="label">
- <property name="geometry">
- <rect>
- <x>180</x>
- <y>60</y>
- <width>57</width>
- <height>15</height>
- </rect>
- </property>
- <property name="text">
- <string>LibLabel</string>
- </property>
- </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
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 <fstream>
-#include <iostream>
-#include <string>
-
-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 <QWidget>
-#include <memory>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
-#include <klocalizedstring.h>
-#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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MyWidget</class>
- <widget class="QWidget" name="MyWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <widget class="QPushButton" name="pushButton">
- <property name="geometry">
- <rect>
- <x>110</x>
- <y>40</y>
- <width>81</width>
- <height>23</height>
- </rect>
- </property>
- <property name="text">
- <string>Special button</string>
- </property>
- </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>