summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-11-18 20:47:05 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-22 10:54:57 +0100
commitce829cbb857bb0b6f49de81b4e5cc9f26ac0b2d1 (patch)
treed636d971edfa93b9f1d1acc788a414c0d70d349c /src/gui/kernel/qwindow.cpp
parentc22602160072638e0b84157757bb8ab2f982acb4 (diff)
Add some properties to QWindow
x,y,width,height,visible and orientation Includes slot setters and notify signals for maximal QML compatibility. Change-Id: I124399093c00f8ad1485d4fbae816dfbe3027eff Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 2878551393..4156fd87e6 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -129,6 +129,7 @@ void QWindow::setVisible(bool visible)
if (d->visible == visible)
return;
d->visible = visible;
+ emit visibleChanged(visible);
if (!d->platformWindow)
create();
@@ -383,10 +384,14 @@ Qt::ScreenOrientation QWindow::orientation() const
void QWindow::setOrientation(Qt::ScreenOrientation orientation)
{
Q_D(QWindow);
+ if (orientation == d->orientation)
+ return;
+
d->orientation = orientation;
if (d->platformWindow) {
d->platformWindow->setOrientation(orientation);
}
+ emit orientationChanged(orientation);
}
Qt::WindowState QWindow::windowState() const
@@ -519,12 +524,25 @@ void QWindow::setSizeIncrement(const QSize &size)
void QWindow::setGeometry(const QRect &rect)
{
Q_D(QWindow);
+ if (rect == geometry())
+ return;
+ QRect oldRect = geometry();
+
d->positionPolicy = QWindowPrivate::WindowFrameExclusive;
if (d->platformWindow) {
d->platformWindow->setGeometry(rect);
} else {
d->geometry = rect;
}
+
+ if (rect.x() != oldRect.x())
+ emit xChanged(rect.x());
+ if (rect.y() != oldRect.y())
+ emit yChanged(rect.y());
+ if (rect.width() != oldRect.width())
+ emit widthChanged(rect.width());
+ if (rect.height() != oldRect.height())
+ emit heightChanged(rect.height());
}
/*!