summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/controls/qquickpopupwindow.cpp1
-rw-r--r--tests/manual/viewinqwidget/main.cpp54
-rw-r--r--tests/manual/viewinqwidget/main.qml50
-rw-r--r--tests/manual/viewinqwidget/viewinqwidget.pro6
4 files changed, 111 insertions, 0 deletions
diff --git a/src/controls/qquickpopupwindow.cpp b/src/controls/qquickpopupwindow.cpp
index 08407e2d..4beed1a6 100644
--- a/src/controls/qquickpopupwindow.cpp
+++ b/src/controls/qquickpopupwindow.cpp
@@ -67,6 +67,7 @@ void QQuickPopupWindow::show()
if (QWindow *tp = transientParent()) {
if (m_parentItem) {
QPointF pos = m_parentItem->mapToItem(m_parentItem->window()->contentItem(), QPointF(posx, posy));
+ pos += tp->mapFromGlobal(m_parentItem->window()->mapToGlobal(QPoint()));
posx = pos.x();
posy = pos.y();
}
diff --git a/tests/manual/viewinqwidget/main.cpp b/tests/manual/viewinqwidget/main.cpp
new file mode 100644
index 00000000..06131641
--- /dev/null
+++ b/tests/manual/viewinqwidget/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** 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 <QQuickView>
+#include <QWidget>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QQuickView *view = new QQuickView;
+ QWidget widget;
+ QWidget *container = QWidget::createWindowContainer(view, &widget);
+ container->setGeometry(100,100,300,300);
+
+ view->setSource(QUrl(QStringLiteral("main.qml")));
+ 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..29d65ae2
--- /dev/null
+++ b/tests/manual/viewinqwidget/main.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** 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.2
+import QtQuick.Controls 1.3
+
+Item {
+ visible: true
+ width: 360
+ height: 360
+
+
+ ComboBox {
+ anchors.centerIn: parent
+ model: [ "Banana", "Apple", "Coconut" ]
+ }
+}
diff --git a/tests/manual/viewinqwidget/viewinqwidget.pro b/tests/manual/viewinqwidget/viewinqwidget.pro
new file mode 100644
index 00000000..fb0f24f4
--- /dev/null
+++ b/tests/manual/viewinqwidget/viewinqwidget.pro
@@ -0,0 +1,6 @@
+QT += qml quick widgets
+TARGET = viewinqwidget
+SOURCES += $$PWD/main.cpp
+
+OTHER_FILES += \
+ qml/main.qml