diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-10-30 12:34:29 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-10-30 14:30:11 +0100 |
commit | 02bdb051ec024b16db93dcb88a377b3eb9f13252 (patch) | |
tree | 23a4c42817ff874d67912639e75cd0fb0a613d89 | |
parent | d9a1bf8ba75bc5be2ccb334a0643dd225b77cb58 (diff) |
Revert "Android: Add separate controller item for android."
Change 336f9c52237e7d9f97c18d2a464aacc48ab62804 (Fix
QWindowControllerItem::geometryChanged()) made the same modification,
this should work for Android as well.
This reverts commit e849a5de6046ccaf2e76e636d640ec322ed87f45.
Change-Id: I9f277a356aca019fd33bb6c092d3b342c94bc64a
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
-rw-r--r-- | src/webview/qwindowcontrolleritem_android.cpp | 84 | ||||
-rw-r--r-- | src/webview/webview-lib.pri | 2 |
2 files changed, 1 insertions, 85 deletions
diff --git a/src/webview/qwindowcontrolleritem_android.cpp b/src/webview/qwindowcontrolleritem_android.cpp deleted file mode 100644 index 495498c..0000000 --- a/src/webview/qwindowcontrolleritem_android.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebView module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 "qwindowcontrolleritem_p.h" - -#include <QtGui/QWindow> -#include <QtQuick/QQuickWindow> - -QWindowControllerItem::QWindowControllerItem(QQuickItem *parent) - : QQuickItem(parent) - , m_controlledWindow(0) -{ - connect(this, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(onWindowChanged(QQuickWindow*))); - connect(this, SIGNAL(visibleChanged()), this, SLOT(onVisibleChanged())); -} - -QWindowControllerItem::~QWindowControllerItem() -{ - delete m_controlledWindow; -} - -void QWindowControllerItem::setNativeWindow(WId windowId) -{ - Q_ASSERT(m_controlledWindow == 0); - m_controlledWindow = QWindow::fromWinId(windowId); - m_controlledWindow->setVisibility(QWindow::Windowed); -} - -void QWindowControllerItem::componentComplete() -{ - QQuickItem::componentComplete(); -} - -void QWindowControllerItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) -{ - QQuickItem::geometryChanged(newGeometry, oldGeometry); - m_controlledWindow->setGeometry(mapRectToScene(newGeometry).toRect()); -} - -void QWindowControllerItem::onWindowChanged(QQuickWindow* window) -{ - if (!m_controlledWindow) - return; - - m_controlledWindow->setParent(window); -} - -void QWindowControllerItem::onVisibleChanged() -{ - m_controlledWindow->setVisible(isVisible()); -} diff --git a/src/webview/webview-lib.pri b/src/webview/webview-lib.pri index a2bd1f4..86d0678 100644 --- a/src/webview/webview-lib.pri +++ b/src/webview/webview-lib.pri @@ -17,7 +17,7 @@ android { SOURCES += \ qwebview_android.cpp \ qwebview.cpp \ - qwindowcontrolleritem_android.cpp + qwindowcontrolleritem.cpp PRIVATE_HEADERS += \ qwebview_android_p.h \ qwindowcontrolleritem_p.h |