summaryrefslogtreecommitdiffstats
path: root/tests/manual/examples/widgets/layouts/borderlayout/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/examples/widgets/layouts/borderlayout/window.cpp')
-rw-r--r--tests/manual/examples/widgets/layouts/borderlayout/window.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/manual/examples/widgets/layouts/borderlayout/window.cpp b/tests/manual/examples/widgets/layouts/borderlayout/window.cpp
new file mode 100644
index 0000000000..ea3b6a6fe8
--- /dev/null
+++ b/tests/manual/examples/widgets/layouts/borderlayout/window.cpp
@@ -0,0 +1,31 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "borderlayout.h"
+#include "window.h"
+#include <QTextBrowser>
+#include <QLabel>
+
+Window::Window()
+{
+ QTextBrowser *centralWidget = new QTextBrowser;
+ centralWidget->setPlainText(tr("Central widget"));
+
+ BorderLayout *layout = new BorderLayout;
+ layout->addWidget(centralWidget, BorderLayout::Center);
+ layout->addWidget(createLabel("North"), BorderLayout::North);
+ layout->addWidget(createLabel("West"), BorderLayout::West);
+ layout->addWidget(createLabel("East 1"), BorderLayout::East);
+ layout->addWidget(createLabel("East 2") , BorderLayout::East);
+ layout->addWidget(createLabel("South"), BorderLayout::South);
+ setLayout(layout);
+
+ setWindowTitle(tr("Border Layout"));
+}
+
+QLabel *Window::createLabel(const QString &text)
+{
+ QLabel *label = new QLabel(text);
+ label->setFrameStyle(QFrame::Box | QFrame::Raised);
+ return label;
+}