Files
qt-creator/tests/manual/layoutbuilder/demo/main.cpp
hjk cc45afdfb0 Layouting: Avoid a lambda in the demo
Change-Id: Ic11936fd2a6da2153a52e39249d49d174ffb8466
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-08 06:58:17 +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);
}