QWindow implementation fixes.

(cherry picked from commit 2682cb6bd76a89c8d4ae81b0dd4a77abbf987c24)
This commit is contained in:
Samuel Rødal 2011-04-26 10:15:33 +02:00
parent dffc816f49
commit 864a2dfa9b
2 changed files with 35 additions and 6 deletions

View File

@ -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);

View File

@ -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;