diff options
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index b1c26a39f1..04098b44c8 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -349,6 +349,41 @@ bool QWindow::isActive() const } } +/*! + Returns the window's currently set orientation. + + The default value is Qt::UnknownOrientation. + + \sa setOrientation(), QScreen::currentOrientation() +*/ +Qt::ScreenOrientation QWindow::orientation() const +{ + Q_D(const QWindow); + return d->orientation; +} + +/*! + Set the orientation of the window's contents. + + This is a hint to the window manager in case it needs to display + additional content like popups, dialogs, status bars, or similar + in relation to the window. + + The recommended orientation is QScreen::currentOrientation() but + an application doesn't have to support all possible orientations, + and thus can opt to ignore the current screen orientation. + + \sa QScreen::currentOrientation() +*/ +void QWindow::setOrientation(Qt::ScreenOrientation orientation) +{ + Q_D(QWindow); + d->orientation = orientation; + if (d->platformWindow) { + d->platformWindow->setOrientation(orientation); + } +} + Qt::WindowState QWindow::windowState() const { Q_D(const QWindow); |