forked from qt-creator/qt-creator
The whole machinery is now almost only layoutbuilder.{h,cpp}, mostly independent of the rest of Utils. Idea is to finish the separation to make it stand-alone usable also outside creator. Change-Id: I958aa667d17ae26b21209f22412309c5307a579c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
// Copyright (C) 2022 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
#include <utils/layoutbuilder.h>
|
|
|
|
#include <QApplication>
|
|
#include <QLineEdit>
|
|
#include <QTextEdit>
|
|
|
|
using namespace Layouting;
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
|
|
auto lineEdit = new QLineEdit("0");
|
|
|
|
auto minusClick = [lineEdit] {
|
|
lineEdit->setText(QString::number(lineEdit->text().toInt() + 1));
|
|
};
|
|
|
|
auto plusClick = [lineEdit] {
|
|
lineEdit->setText(QString::number(lineEdit->text().toInt() + 1));
|
|
};
|
|
|
|
Row {
|
|
PushButton { text("-"), onClicked(minusClick) },
|
|
lineEdit,
|
|
PushButton { text("+"), onClicked(plusClick) },
|
|
Group {
|
|
title("Splitter in Group"),
|
|
Column {
|
|
Splitter {
|
|
new QTextEdit("First Widget"),
|
|
new QTextEdit("Second Widget"),
|
|
},
|
|
}
|
|
},
|
|
}.emerge()->show();
|
|
|
|
return app.exec();
|
|
}
|