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;