Files
qt-creator/tests/manual/layoutbuilder/demo/main.cpp
hjk 2e7930b56e LayoutBuilder: Rename Id to ID
The Id was only used in the demo. "ID" is Not exactly canonical naming,
but this clashes often with Utils::Id, so mis-spell until we settle on a
proper name.

Change-Id: I6fdf806c41abf224f7422ec6c9263db3eb357190
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:59:13 +00:00

42 lines
820 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);
}