mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-03 15:55:27 +08:00
qt 6.5.1 original
This commit is contained in:
37
tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
Normal file
37
tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
if(POLICY CMP0099)
|
||||
cmake_policy(SET CMP0099 NEW) # Avoid CMP0099 related warnings.
|
||||
endif()
|
||||
|
||||
project(test_dependent_modules)
|
||||
|
||||
find_package(Qt6Widgets REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# make sure CMP0071 warnings cause a test failure
|
||||
set(CMAKE_SUPPRESS_DEVELOPER_ERRORS FALSE CACHE INTERNAL "" FORCE)
|
||||
|
||||
qt_wrap_cpp(moc_files mywidget.h)
|
||||
qt_wrap_ui(ui_files mywidget.ui)
|
||||
qt_add_resources(qrc_files res.qrc)
|
||||
|
||||
add_executable(mywidget
|
||||
# source files
|
||||
mywidget.cpp
|
||||
mywidget.h
|
||||
mywidget.ui
|
||||
res.qrc
|
||||
|
||||
# generated files
|
||||
${moc_files}
|
||||
${ui_files}
|
||||
${qrc_files}
|
||||
)
|
||||
target_link_libraries(mywidget PRIVATE Qt::Widgets)
|
18
tests/auto/cmake/test_QTBUG-63422/mywidget.cpp
Normal file
18
tests/auto/cmake/test_QTBUG-63422/mywidget.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Kevin Funk <kevin.funk@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "mywidget.h"
|
||||
#include "ui_mywidget.h"
|
||||
|
||||
MyWidget::MyWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
emit someSignal();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
MyWidget myWidget;
|
||||
return 0;
|
||||
}
|
27
tests/auto/cmake/test_QTBUG-63422/mywidget.h
Normal file
27
tests/auto/cmake/test_QTBUG-63422/mywidget.h
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Kevin Funk <kevin.funk@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#ifndef MYWIDGET_H
|
||||
#define MYWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MyWidget;
|
||||
}
|
||||
|
||||
class MyWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyWidget(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void someSignal();
|
||||
|
||||
private:
|
||||
Ui::MyWidget *ui = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
34
tests/auto/cmake/test_QTBUG-63422/mywidget.ui
Normal file
34
tests/auto/cmake/test_QTBUG-63422/mywidget.ui
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<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>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
4
tests/auto/cmake/test_QTBUG-63422/res.qrc
Normal file
4
tests/auto/cmake/test_QTBUG-63422/res.qrc
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
</qresource>
|
||||
</RCC>
|
Reference in New Issue
Block a user