This commit is contained in:
+10
-2
@@ -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)
|
||||
target_link_libraries(${target} PRIVATE Qt6::Quick)
|
||||
+8
-4
@@ -1,6 +1,10 @@
|
||||
#include <print>
|
||||
#include <QtGui>
|
||||
#include <QtQml>
|
||||
|
||||
int main() {
|
||||
std::println("Test\n");
|
||||
return 0;
|
||||
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();
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user