diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 094eb35..135df69 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,7 +1,15 @@ set(target mainApp) -add_executable(${target} main.cpp) +qt_add_executable(${target} + main.cpp +) + +qt_add_qml_module(${target} + URI app + QML_FILES + main.qml +) target_compile_features(${target} PRIVATE cxx_std_23) -# target_link_libraries(${target} PRIVATE) \ No newline at end of file +target_link_libraries(${target} PRIVATE Qt6::Quick) \ No newline at end of file diff --git a/app/main.cpp b/app/main.cpp index 2963996..0142519 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,6 +1,10 @@ -#include +#include +#include -int main() { - std::println("Test\n"); - return 0; -} \ No newline at end of file +int main(int argc, char **argv) { + QGuiApplication app(argc, argv); + QUrl source(QStringLiteral("qrc:/qt/qml/app/main.qml")); + QQmlApplicationEngine engine; + engine.load(source); + return app.exec(); +} diff --git a/app/main.qml b/app/main.qml new file mode 100644 index 0000000..d5c3bca --- /dev/null +++ b/app/main.qml @@ -0,0 +1,21 @@ +import QtQuick +import QtQuick.Controls + +ApplicationWindow { + width: 400 + height: 400 + visible: true + + Button { + id: button + text: "A Special Button" + background: Rectangle { + implicitWidth: 100 + implicitHeight: 40 + color: button.down ? "#d6d6d6" : "#f6f6f6" + border.color: "#26282a" + border.width: 1 + radius: 4 + } + } +} \ No newline at end of file