diff options
-rw-r--r-- | src/quick/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignersupport.cpp | 14 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignersupport_p.h | 3 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignerwindowmanager.cpp | 125 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignerwindowmanager_p.h | 108 |
5 files changed, 0 insertions, 251 deletions
diff --git a/src/quick/CMakeLists.txt b/src/quick/CMakeLists.txt index 6feb0e807a..372df6cfd8 100644 --- a/src/quick/CMakeLists.txt +++ b/src/quick/CMakeLists.txt @@ -345,7 +345,6 @@ qt_internal_extend_target(Quick CONDITION QT_FEATURE_quick_designer designer/qquickdesignersupportproperties.cpp designer/qquickdesignersupportproperties_p.h designer/qquickdesignersupportpropertychanges.cpp designer/qquickdesignersupportpropertychanges_p.h designer/qquickdesignersupportstates.cpp designer/qquickdesignersupportstates_p.h - designer/qquickdesignerwindowmanager.cpp designer/qquickdesignerwindowmanager_p.h ) qt_internal_extend_target(Quick CONDITION QT_FEATURE_accessibility diff --git a/src/quick/designer/qquickdesignersupport.cpp b/src/quick/designer/qquickdesignersupport.cpp index fe9bb945b4..24b22a2d0f 100644 --- a/src/quick/designer/qquickdesignersupport.cpp +++ b/src/quick/designer/qquickdesignersupport.cpp @@ -47,7 +47,6 @@ #include <QtQml/private/qabstractanimationjob_p.h> #include <private/qqmlengine_p.h> #include <private/qquickview_p.h> -#include <private/qsgrenderloop_p.h> #include <QtQuick/private/qquickstategroup_p.h> #include <QtGui/QImage> #include <private/qqmlvme_p.h> @@ -55,9 +54,6 @@ #include <private/qqmldata_p.h> #include <private/qsgadaptationlayer_p.h> -#include "qquickdesignerwindowmanager_p.h" - - QT_BEGIN_NAMESPACE QQuickDesignerSupport::QQuickDesignerSupport() @@ -453,11 +449,6 @@ void QQuickDesignerSupport::updateDirtyNode(QQuickItem *item) QQuickWindowPrivate::get(item->window())->updateDirtyNode(item); } -void QQuickDesignerSupport::activateDesignerWindowManager() -{ - QSGRenderLoop::setInstance(new QQuickDesignerWindowManager); -} - void QQuickDesignerSupport::activateDesignerMode() { QQmlEnginePrivate::activateDesignerMode(); @@ -473,11 +464,6 @@ void QQuickDesignerSupport::enableComponentComplete() QQmlVME::enableComponentComplete(); } -void QQuickDesignerSupport::createOpenGLContext(QQuickWindow *window) -{ - QQuickDesignerWindowManager::createOpenGLContext(window); -} - void QQuickDesignerSupport::polishItems(QQuickWindow *window) { QQuickWindowPrivate::get(window)->polishItems(); diff --git a/src/quick/designer/qquickdesignersupport_p.h b/src/quick/designer/qquickdesignersupport_p.h index fc46745e15..6d2da6aa35 100644 --- a/src/quick/designer/qquickdesignersupport_p.h +++ b/src/quick/designer/qquickdesignersupport_p.h @@ -143,14 +143,11 @@ public: static void updateDirtyNode(QQuickItem *item); - static void activateDesignerWindowManager(); static void activateDesignerMode(); static void disableComponentComplete(); static void enableComponentComplete(); - static void createOpenGLContext(QQuickWindow *window); - static void polishItems(QQuickWindow *window); private: diff --git a/src/quick/designer/qquickdesignerwindowmanager.cpp b/src/quick/designer/qquickdesignerwindowmanager.cpp deleted file mode 100644 index 18daab70e8..0000000000 --- a/src/quick/designer/qquickdesignerwindowmanager.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickdesignerwindowmanager_p.h" -#include "private/qquickwindow_p.h" -#include "private/qquickitem_p.h" -#include <QtQuick/QQuickWindow> -#if QT_CONFIG(opengl) -#include <private/qsgdefaultrendercontext_p.h> -#endif - -QT_BEGIN_NAMESPACE - -QQuickDesignerWindowManager::QQuickDesignerWindowManager() - : m_sgContext(QSGContext::createDefaultContext()) -{ - m_renderContext.reset(m_sgContext.data()->createRenderContext()); -} - -void QQuickDesignerWindowManager::show(QQuickWindow *window) -{ - makeOpenGLContext(window); -} - -void QQuickDesignerWindowManager::hide(QQuickWindow *) -{ -} - -void QQuickDesignerWindowManager::windowDestroyed(QQuickWindow *) -{ -} - -void QQuickDesignerWindowManager::makeOpenGLContext(QQuickWindow *window) -{ -#if QT_CONFIG(opengl) - if (!m_openGlContext) { - m_openGlContext.reset(new QOpenGLContext()); - m_openGlContext->setFormat(window->requestedFormat()); - m_openGlContext->create(); - if (!m_openGlContext->makeCurrent(window)) - qWarning("QQuickWindow: makeCurrent() failed..."); - QSGDefaultRenderContext::InitParams params; - params.sampleCount = qMax(1, m_openGlContext->format().samples()); - // ### glpurge Designer's RHI migration is left as a future exercise (QTBUG-78598) - //params.openGLContext = m_openGlContext.data(); - params.initialSurfacePixelSize = window->size() * window->effectiveDevicePixelRatio(); - params.maybeSurface = window; - m_renderContext->initialize(¶ms); - } else { - m_openGlContext->makeCurrent(window); - } -#else - Q_UNUSED(window); -#endif -} - -void QQuickDesignerWindowManager::exposureChanged(QQuickWindow *) -{ -} - -QImage QQuickDesignerWindowManager::grab(QQuickWindow *) -{ - return QImage(); -} - -void QQuickDesignerWindowManager::maybeUpdate(QQuickWindow *) -{ -} - -QSGContext *QQuickDesignerWindowManager::sceneGraphContext() const -{ - return m_sgContext.data(); -} - -void QQuickDesignerWindowManager::createOpenGLContext(QQuickWindow *window) -{ - window->create(); - window->update(); -} - -void QQuickDesignerWindowManager::update(QQuickWindow *window) -{ - makeOpenGLContext(window); -} - -QT_END_NAMESPACE - - -#include "moc_qquickdesignerwindowmanager_p.cpp" diff --git a/src/quick/designer/qquickdesignerwindowmanager_p.h b/src/quick/designer/qquickdesignerwindowmanager_p.h deleted file mode 100644 index ac9695953f..0000000000 --- a/src/quick/designer/qquickdesignerwindowmanager_p.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DESIGNERWINDOWMANAGER_P_H -#define DESIGNERWINDOWMANAGER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/QScopedPointer> - -#include <private/qsgrenderloop_p.h> -#include <private/qtquickglobal_p.h> -#include <private/qsgcontext_p.h> - -#if QT_CONFIG(opengl) -# include <QOpenGLContext> -#endif - -QT_BEGIN_NAMESPACE - -class QQuickWindow; -class QSGContext; -class QSGDefaultRenderContext; -class QAnimationDriver; - -class QQuickDesignerWindowManager : public QSGRenderLoop -{ - Q_OBJECT -public: - QQuickDesignerWindowManager(); - - void show(QQuickWindow *window) override; - void hide(QQuickWindow *window) override; - - void windowDestroyed(QQuickWindow *window) override; - - void makeOpenGLContext(QQuickWindow *window); - void exposureChanged(QQuickWindow *window) override; - QImage grab(QQuickWindow *window) override; - - void maybeUpdate(QQuickWindow *window) override; - void update(QQuickWindow *window) override; // identical for this implementation. - - void releaseResources(QQuickWindow *) override { } - - QAnimationDriver *animationDriver() const override { return nullptr; } - - QSGContext *sceneGraphContext() const override; - QSGRenderContext *createRenderContext(QSGContext *) const override { return m_renderContext.data(); } - - static void createOpenGLContext(QQuickWindow *window); - -private: -#if QT_CONFIG(opengl) - QScopedPointer<QOpenGLContext> m_openGlContext; -#endif - QScopedPointer<QSGContext> m_sgContext; - QScopedPointer<QSGRenderContext> m_renderContext; -}; - -QT_END_NAMESPACE - -#endif // DESIGNERWINDOWMANAGER_P_H |