diff options
Diffstat (limited to 'tests/auto/tools/qt_cmake_create/testdata/ui_project')
5 files changed, 107 insertions, 0 deletions
diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/CMakeLists.txt.expected b/tests/auto/tools/qt_cmake_create/testdata/ui_project/CMakeLists.txt.expected new file mode 100644 index 0000000000..6252b71389 --- /dev/null +++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/CMakeLists.txt.expected @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.16) +project(ui_project LANGUAGES CXX) + +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) +qt_standard_project_setup() + +qt_add_executable(ui_project + main.cpp + widget.cpp + widget.h +) + +target_sources(ui_project + PRIVATE + widget.ui +) + +target_link_libraries(ui_project + PRIVATE + Qt::Core + Qt::Gui + Qt::Widgets +) diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp b/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp new file mode 100644 index 0000000000..2e74e1c140 --- /dev/null +++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp @@ -0,0 +1,13 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include "widget.h" + +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + Widget w; + w.show(); + return a.exec(); +} diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp new file mode 100644 index 0000000000..65c5eae0c9 --- /dev/null +++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp @@ -0,0 +1,16 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include "widget.h" +#include "ui_widget.h" + +Widget::Widget(QWidget *parent) + : QWidget(parent) + , ui(new Ui::Widget) +{ + ui->setupUi(this); +} + +Widget::~Widget() +{ + delete ui; +} diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h new file mode 100644 index 0000000000..9110f2a20b --- /dev/null +++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h @@ -0,0 +1,23 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#ifndef WIDGET_H +#define WIDGET_H + +#include <QWidget> + +QT_BEGIN_NAMESPACE +namespace Ui { class Widget; } +QT_END_NAMESPACE + +class Widget : public QWidget +{ + Q_OBJECT + +public: + Widget(QWidget *parent = nullptr); + ~Widget(); + +private: + Ui::Widget *ui; +}; +#endif // WIDGET_H diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.ui b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.ui new file mode 100644 index 0000000000..d2c4f620b1 --- /dev/null +++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.ui @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Widget</class> + <widget class="QWidget" name="Widget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>Widget</string> + </property> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>6</y> + <width>781</width> + <height>581</height> + </rect> + </property> + <property name="text"> + <string>Now I have CMakeLists.txt. Thanks!</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> |