Files
qt-creator/tests/manual/layoutbuilder/demo/main.cpp
hjk 62f3d29be4 Layouting: Introduce Ids for Items
Intenally just wrapping a 'bindTo' result, but less trigger potential
for pointer related peladophobia

Change-Id: I25171a2675fb0474ce97c04552ac1cf5ffd6ee56
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 15:08:23 +00:00

42 lines
830 B
C++

// 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);
}