From 864a2dfa9b1e172c6c86f24f2be1e696edbbe578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 26 Apr 2011 10:15:33 +0200 Subject: [PATCH] QWindow implementation fixes. (cherry picked from commit 2682cb6bd76a89c8d4ae81b0dd4a77abbf987c24) --- src/gui/kernel/qwindow_qpa.cpp | 34 ++++++++++++++++++++++++++++++---- src/gui/kernel/qwindow_qpa.h | 7 +++++-- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qwindow_qpa.cpp b/src/gui/kernel/qwindow_qpa.cpp index ad5f22aaf9..dff009931c 100644 --- a/src/gui/kernel/qwindow_qpa.cpp +++ b/src/gui/kernel/qwindow_qpa.cpp @@ -51,10 +51,10 @@ QT_BEGIN_NAMESPACE class QWindowPrivate : public QObjectPrivate{ - QWindowPrivate(const QWindowFormat &requestedFormat) + QWindowPrivate() : QObjectPrivate() + , types(0) , platformWindow(0) - , requestedFormat(requestedFormat) , glContext(0) { @@ -66,6 +66,7 @@ class QWindowPrivate : public QObjectPrivate{ } private: + QWindow::WindowTypes windowTypes; QPlatformWindow *platformWindow; QWindowFormat requestedFormat; QString windowTitle; @@ -73,10 +74,11 @@ private: QGLContext *glContext; }; -QWindow::QWindow(const QWindowFormat &format, QWindow *parent) +QWindow::QWindow(WindowTypes types, QWindow *parent) : QObject(*new QWindowPrivate(format), parent) { - + Q_D(QWindow); + d->windowTypes = types; } void QWindow::setVisible(bool visible) @@ -118,6 +120,30 @@ void QWindow::setParent(const QWindow *parent) d->platformWindow->setParent(parent->d_func()->platformWindow); } +void QWindow::setWindowFormat(const QWindowFormat &format) +{ + Q_D(QWindow); + d->requestedFormat = format; +} + +QWindowFormat QWindow::requestedWindowFormat() const +{ + Q_D(const QWindow); + return d->requestedFormat; +} + +QWindowFormat QWindow::actualWindowFormat() const +{ + Q_D(const QWindow); + return d->requestedFormat; +} + +WindowTypes QWindow::types() const +{ + Q_D(const QWindow); + return d->windowTypes; +} + void QWindow::setWindowTitle(const QString &title) { Q_D(QWindow); diff --git a/src/gui/kernel/qwindow_qpa.h b/src/gui/kernel/qwindow_qpa.h index 1a40ab510a..c191de3bde 100644 --- a/src/gui/kernel/qwindow_qpa.h +++ b/src/gui/kernel/qwindow_qpa.h @@ -71,7 +71,7 @@ public: }; Q_DECLARE_FLAGS(WindowTypes, WindowType) - QWindow(WindowType type = Window, QWindow *parent = 0); + QWindow(WindowTypes types = Window, QWindow *parent = 0); void setVisible(bool visible); void create(); @@ -79,7 +79,10 @@ public: void setParent(const QWindow *parent); void setWindowFormat(const QWindowFormat &format); - QWindowFormat windowFormat() const; + QWindowFormat requestedWindowFormat() const; + QWindowFormat actualWindowFormat() const; + + WindowTypes types() const; QString windowTitle() const;