diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qplatformsurface.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qplatformsurface_qpa.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qplatformwindow_qpa.cpp | 16 |
3 files changed, 11 insertions, 17 deletions
diff --git a/src/gui/kernel/qplatformsurface.h b/src/gui/kernel/qplatformsurface.h index a10ae6f1e5..b902f9b1f6 100644 --- a/src/gui/kernel/qplatformsurface.h +++ b/src/gui/kernel/qplatformsurface.h @@ -66,12 +66,12 @@ public: virtual ~QPlatformSurface(); virtual QSurfaceFormat format() const = 0; - QSurface::SurfaceClass surfaceClass() const; + QSurface *surface() const; private: - explicit QPlatformSurface(QSurface::SurfaceClass type); + explicit QPlatformSurface(QSurface *surface); - QSurface::SurfaceClass m_type; + QSurface *m_surface; friend class QPlatformWindow; }; diff --git a/src/gui/kernel/qplatformsurface_qpa.cpp b/src/gui/kernel/qplatformsurface_qpa.cpp index 50cdd68ab6..464c971b98 100644 --- a/src/gui/kernel/qplatformsurface_qpa.cpp +++ b/src/gui/kernel/qplatformsurface_qpa.cpp @@ -57,12 +57,12 @@ QPlatformSurface::~QPlatformSurface() } -QSurface::SurfaceClass QPlatformSurface::surfaceClass() const +QSurface *QPlatformSurface::surface() const { - return m_type; + return m_surface; } -QPlatformSurface::QPlatformSurface(QSurface::SurfaceClass type) : m_type(type) +QPlatformSurface::QPlatformSurface(QSurface *surface) : m_surface(surface) { } diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index 4e464d7838..01254966f0 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE class QPlatformWindowPrivate { - QWindow *window; QRect rect; friend class QPlatformWindow; }; @@ -59,11 +58,10 @@ class QPlatformWindowPrivate */ QPlatformWindow::QPlatformWindow(QWindow *window) - : QPlatformSurface(QSurface::Window) + : QPlatformSurface(window) , d_ptr(new QPlatformWindowPrivate) { Q_D(QPlatformWindow); - d->window = window; d->rect = window->geometry(); } @@ -79,8 +77,7 @@ QPlatformWindow::~QPlatformWindow() */ QWindow *QPlatformWindow::window() const { - Q_D(const QPlatformWindow); - return d->window; + return static_cast<QWindow *>(m_surface); } /*! @@ -88,8 +85,7 @@ QWindow *QPlatformWindow::window() const */ QPlatformWindow *QPlatformWindow::parent() const { - Q_D(const QPlatformWindow); - return d->window->parent() ? d->window->parent()->handle() : 0; + return window()->parent() ? window()->parent()->handle() : 0; } /*! @@ -97,8 +93,7 @@ QPlatformWindow *QPlatformWindow::parent() const */ QPlatformScreen *QPlatformWindow::screen() const { - Q_D(const QPlatformWindow); - return d->window->screen()->handle(); + return window()->screen()->handle(); } /*! @@ -170,8 +165,7 @@ Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags) bool QPlatformWindow::isExposed() const { - Q_D(const QPlatformWindow); - return d->window->isVisible(); + return window()->isVisible(); } /*! |