diff --git a/experimental/dynamic_quick/CMakeLists.txt b/experimental/dynamic_quick/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6637b7e89fc703b6a015a6a5ae3c5d41d7e924df --- /dev/null +++ b/experimental/dynamic_quick/CMakeLists.txt @@ -0,0 +1,39 @@ +project(dynamicquick) +cmake_minimum_required(VERSION 3.19) + +find_package(Qt6 COMPONENTS Core Gui Quick) + +qt_standard_project_setup() + +qt_add_executable(dynamicquick + main.cpp +) + +target_link_libraries(dynamicquick PUBLIC + Qt::Core + Qt::Gui + Qt::Quick +) + +qt_add_resources(dynamicquick "qml" + PREFIX "/" + FILES + hello.qml +) + +install(TARGETS dynamicquick + BUNDLE DESTINATION . + RUNTIME DESTINATION . +) + +qt_generate_deploy_app_script( + TARGET dynamicquick + OUTPUT_SCRIPT deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR +) +install(SCRIPT ${deploy_script}) + +# Copy plugin preload files to the build directory. +configure_file(qt_plugins.json qt_plugins.json COPYONLY) +configure_file(qt_qml_imports.json qt_qml_imports.json COPYONLY) +configure_file(qt.conf qt.conf COPYONLY) diff --git a/experimental/dynamic_quick/hello.qml b/experimental/dynamic_quick/hello.qml new file mode 100644 index 0000000000000000000000000000000000000000..25baa8f4620ce5261e8ff557304743314efe3da0 --- /dev/null +++ b/experimental/dynamic_quick/hello.qml @@ -0,0 +1,14 @@ +import QtQuick +import QtQuick.Window + +Window { + width: 640 + height: 480 + visible: true + + Text { + text: "Hello World from dynamically linked Qt Quick!" + font.pointSize: 12 + anchors.verticalCenter: parent.verticalCenter + } +} \ No newline at end of file diff --git a/experimental/dynamic_quick/main.cpp b/experimental/dynamic_quick/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ec1c31e9ec62f36f386ae399261cda7b9c38b8f --- /dev/null +++ b/experimental/dynamic_quick/main.cpp @@ -0,0 +1,9 @@ +#include <QtGui> +#include <QtQml> + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine("qrc:/hello.qml"); + app.exec(); +} diff --git a/experimental/dynamic_quick/qt.conf b/experimental/dynamic_quick/qt.conf new file mode 100644 index 0000000000000000000000000000000000000000..1ca76f9839fc2b11d06922073c3c6b4718718158 --- /dev/null +++ b/experimental/dynamic_quick/qt.conf @@ -0,0 +1,2 @@ +[Paths] +Prefix = /qt diff --git a/experimental/dynamic_quick/qt_plugins.json b/experimental/dynamic_quick/qt_plugins.json new file mode 100644 index 0000000000000000000000000000000000000000..4ff3101b828270d906fca310b701d66c43d87ec5 --- /dev/null +++ b/experimental/dynamic_quick/qt_plugins.json @@ -0,0 +1,14 @@ +[ + { + "source": "$QTDIR/plugins/platforms/libqwasm.so", + "destination": "/qt/plugins/platforms/libqwasm.so" + }, + { + "source": "$QTDIR/plugins/imageformats/libqjpeg.so", + "destination": "/qt/plugins/imageformats/libqjpeg.so" + }, + { + "source": "qt.conf", + "destination": "/qt.conf" + } +] diff --git a/experimental/dynamic_quick/qt_qml_imports.json b/experimental/dynamic_quick/qt_qml_imports.json new file mode 100644 index 0000000000000000000000000000000000000000..f68d78fae42ffc0ea15aef56641fff125120c3ec --- /dev/null +++ b/experimental/dynamic_quick/qt_qml_imports.json @@ -0,0 +1,10 @@ +[ + { + "source": "$QTDIR/qml/QtQuick/Window/libquickwindowplugin.so", + "destination": "/qt/qml/QtQuick/Window/libquickwindowplugin.so" + }, + { + "source": "$QTDIR/qml/QtQuick/Window/qmldir", + "destination": "/qt/qml/QtQuick/Window/qmldir" + } +] \ No newline at end of file