aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/viewinqwidget
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-28 17:20:42 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-28 17:22:53 +0100
commit8318deb165047d592523ec0b2fd10510d4953b37 (patch)
treee80c082fbe6918e489f61d4f06deb29bbc12fa32 /tests/manual/viewinqwidget
parent85dc3eb5d0e19d024083a9776d1ac8cf31d708ca (diff)
parent135b5cdecaeaecb1f3afe01103eac5970399efa7 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/imports/controls/material/qtlabsmaterialstyleplugin.cpp src/templates/qquickapplicationwindow_p.h src/templates/qquickcombobox.cpp src/templates/qquickcombobox_p.h src/templates/qquickpopup.cpp Change-Id: Ibd87e907bc8abf1f675147761ea8bb0b40722478
Diffstat (limited to 'tests/manual/viewinqwidget')
-rw-r--r--tests/manual/viewinqwidget/main.cpp89
-rw-r--r--tests/manual/viewinqwidget/main.qml49
-rw-r--r--tests/manual/viewinqwidget/viewinqwidget.pro6
-rw-r--r--tests/manual/viewinqwidget/viewinqwidget.qrc5
4 files changed, 149 insertions, 0 deletions
diff --git a/tests/manual/viewinqwidget/main.cpp b/tests/manual/viewinqwidget/main.cpp
new file mode 100644
index 00000000..3611e071
--- /dev/null
+++ b/tests/manual/viewinqwidget/main.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QDebug>
+#include <QDesktopWidget>
+#include <QGroupBox>
+#include <QQmlApplicationEngine>
+#include <QQmlError>
+#include <QQuickView>
+#include <QQuickWidget>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QWidget widget;
+ widget.setWindowTitle(QT_VERSION_STR);
+
+ QHBoxLayout *hLayout = new QHBoxLayout(&widget);
+ QGroupBox *groupBox = new QGroupBox("QuickWidget", &widget);
+ QVBoxLayout *vLayout = new QVBoxLayout(groupBox);
+ QQuickWidget *quickWidget = new QQuickWidget(groupBox);
+ quickWidget->setMinimumSize(360, 520);
+ vLayout->addWidget(quickWidget);
+ quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
+ quickWidget->setSource(QUrl(QLatin1String("qrc:/main.qml")));
+ if (quickWidget->status() == QQuickWidget::Error) {
+ qWarning() << quickWidget->errors();
+ return 1;
+ }
+ hLayout->addWidget(groupBox);
+
+ const QUrl gallerySource(QLatin1String("qrc:/gallery.qml"));
+ QQmlApplicationEngine engine(gallerySource);
+ QObject *root = engine.rootObjects().value(0, nullptr);
+ if (!root || !root->isWindowType()) {
+ qWarning() << "Load error" << gallerySource;
+ return 1;
+ }
+ groupBox = new QGroupBox("QQuickView/createWindowContainer", &widget);
+ vLayout = new QVBoxLayout(groupBox);
+ QWidget *container = QWidget::createWindowContainer(qobject_cast<QWindow *>(root), groupBox);
+ container->setMinimumSize(360, 520);
+ vLayout->addWidget(container);
+ hLayout->addWidget(groupBox);
+
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&widget);
+ widget.move(availableGeometry.center() - QPoint(widget.sizeHint().width() / 2, widget.sizeHint().height() / 2));
+
+ widget.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/viewinqwidget/main.qml b/tests/manual/viewinqwidget/main.qml
new file mode 100644
index 00000000..36a0b133
--- /dev/null
+++ b/tests/manual/viewinqwidget/main.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import Qt.labs.controls 1.0
+
+Item {
+ visible: true
+ width: 360
+ height: 520
+
+ ComboBox {
+ model: ["First", "Second", "Third"]
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/viewinqwidget/viewinqwidget.pro b/tests/manual/viewinqwidget/viewinqwidget.pro
new file mode 100644
index 00000000..9b7cba00
--- /dev/null
+++ b/tests/manual/viewinqwidget/viewinqwidget.pro
@@ -0,0 +1,6 @@
+QT += qml quick widgets quickwidgets
+TARGET = viewinqwidget
+SOURCES += $$PWD/main.cpp
+OTHER_FILES += main.qml
+RESOURCES += viewinqwidget.qrc \
+ ../../../examples/controls/gallery/gallery.qrc
diff --git a/tests/manual/viewinqwidget/viewinqwidget.qrc b/tests/manual/viewinqwidget/viewinqwidget.qrc
new file mode 100644
index 00000000..5f6483ac
--- /dev/null
+++ b/tests/manual/viewinqwidget/viewinqwidget.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>