Files
qt-creator/tests/manual/layoutbuilder/demo/main.cpp
hjk 123793fbb1 Utils: Add an 'If' LayoutItem
Change-Id: I700e28d03b6dc39e96fa969152f236760989bdb7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-15 13:03:11 +00:00

50 lines
1.0 KiB
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 {
If { false, {
TextEdit {
id(textId),
text("Hallo")
},
}, {
TextEdit {
id(textId),
text("Och noe")
},
}
},
Row {
SpinBox {
onTextChanged([&](const QString &text) { setText(textId, text); })
},
Stretch(),
PushButton {
text("Quit"),
onClicked(QApplication::quit)
},
}
}
};
return app.exec(argc, argv);
}