aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/layoutbuilder/demo/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/layoutbuilder/demo/main.cpp')
-rw-r--r--tests/manual/layoutbuilder/demo/main.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/manual/layoutbuilder/demo/main.cpp b/tests/manual/layoutbuilder/demo/main.cpp
new file mode 100644
index 00000000000..2dd95dfddbf
--- /dev/null
+++ b/tests/manual/layoutbuilder/demo/main.cpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "layoutbuilder.h"
+
+#include <QApplication>
+
+using namespace Layouting;
+
+int main(int argc, char *argv[])
+{
+ ID textId;
+
+ Application app
+ {
+ resize(600, 400),
+ title("Hello World"),
+
+ Column {
+ TextEdit {
+ id(textId),
+ text("Hallo")
+ },
+
+ Row {
+ SpinBox {
+ onTextChanged([&](const QString &text) { setText(textId, text); })
+ },
+
+ Stretch(),
+
+ PushButton {
+ text("Quit"),
+ onClicked(QApplication::quit)
+ },
+ }
+ }
+ };
+
+ return app.exec(argc, argv);
+}