mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-07 01:35:25 +08:00
qt 6.6.0 clean
This commit is contained in:
27
tests/auto/tools/qt_cmake_create/testdata/qml_project/CMakeLists.txt.expected
vendored
Normal file
27
tests/auto/tools/qt_cmake_create/testdata/qml_project/CMakeLists.txt.expected
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(qml_project LANGUAGES CXX)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Gui Qml Quick Core)
|
||||
qt_standard_project_setup()
|
||||
|
||||
qt_add_executable(qml_project
|
||||
main.cpp
|
||||
)
|
||||
|
||||
qt_add_qml_module(qml_project
|
||||
URI qml_project
|
||||
OUTPUT_DIRECTORY qml
|
||||
VERSION 1.0
|
||||
RESOURCE_PREFIX /qt/qml
|
||||
QML_FILES
|
||||
TestComponent.qml
|
||||
main.qml
|
||||
)
|
||||
|
||||
target_link_libraries(qml_project
|
||||
PRIVATE
|
||||
Qt::Gui
|
||||
Qt::Qml
|
||||
Qt::Quick
|
||||
Qt::Core
|
||||
)
|
4
tests/auto/tools/qt_cmake_create/testdata/qml_project/TestComponent.qml
vendored
Normal file
4
tests/auto/tools/qt_cmake_create/testdata/qml_project/TestComponent.qml
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
}
|
18
tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
vendored
Normal file
18
tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
const QUrl url(QStringLiteral("qrc:/qt/qml/qml_project/main.qml"));
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
&app, [url](QObject *obj, const QUrl &objUrl) {
|
||||
if (!obj && url == objUrl)
|
||||
QCoreApplication::exit(-1);
|
||||
}, Qt::QueuedConnection);
|
||||
engine.load(url);
|
||||
|
||||
return app.exec();
|
||||
}
|
16
tests/auto/tools/qt_cmake_create/testdata/qml_project/main.qml
vendored
Normal file
16
tests/auto/tools/qt_cmake_create/testdata/qml_project/main.qml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
|
||||
Window {
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
title: "Hello World"
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
font.pointSize: 16
|
||||
text: "Now I have CMakeLists.txt. Thanks!"
|
||||
}
|
||||
TestComponent {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user