diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2012-10-22 17:06:23 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-08 15:01:30 +0100 |
commit | 672e7c875e8680818e23d0aef98129d95eb7e91c (patch) | |
tree | b0322db8df580418c59978f3b9d48f5486a41128 /src/gui/kernel/qwindow.cpp | |
parent | 9be15cc1dc277a2a015b7e00ef88cd25b105c24c (diff) |
Remove QWindow pos, geometry and size as properties; pos->position
Abbreviated properties are to be avoided. But all 3 of these
properties are redundant from the QML perspective; and because QRect,
QPoint and QSize are (wisely) not QObjects, it's not possible to bind
to _their_ properties, which make these QWindow properties less useful
than users might assume that they are.
Change-Id: I19c00b54b1d2712f9418e8bcf56e35a8008b89ef
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index dd0e4dd993..9fb3c70efb 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1056,9 +1056,14 @@ void QWindow::setSizeIncrement(const QSize &size) Sets the geometry of the window, excluding its window frame, to a rectangle constructed from \a posx, \a posy, \a w and \a h. - \sa geometry + \sa geometry() */ +/*! + \brief Sets the geometry of the window, excluding its window frame, to \a rect. + + \sa geometry() +*/ void QWindow::setGeometry(const QRect &rect) { Q_D(QWindow); @@ -1198,40 +1203,52 @@ void QWindow::setFramePos(const QPoint &point) } /*! - \property QWindow::pos - \brief the position of the window on the desktop + \fn void QWindow::setPosition(const QPoint &pt) + \brief set the position of the window on the desktop to \a pt + + \sa position() +*/ + +/*! + \fn void QWindow::setPosition(int posx, int posy) + \brief set the position of the window on the desktop to \a posx, \a posy - \sa geometry + \sa position() */ /*! - \property QWindow::size - \brief the size of the window excluding any window frame + \fn QPoint QWindow::position() const + \brief get the position of the window on the desktop excluding any window frame - \sa geometry + \sa setPosition() */ /*! - \property QWindow::geometry - \brief the geometry of the window excluding any window frame + \fn QSize QWindow::size() const + \brief get the size of the window excluding any window frame - To make sure the window is visible, make sure the geometry is within - the virtual geometry of its screen. + \sa resize() +*/ - See the \l{Window Geometry} documentation for an overview of geometry - issues with windows. +/*! + \fn void QWindow::resize(int w, int h) - By default, this property contains a value that depends on the user's - platform and screen geometry. + set the size of the window, excluding any window frame, to a QSize + constructed from width \a w and height \a h - \sa size, pos + \sa size(), geometry() */ +/*! + \brief set the size of the window, excluding any window frame, to \a newSize + + \sa size(), geometry() +*/ void QWindow::resize(const QSize &newSize) { Q_D(QWindow); if (d->platformWindow) { - d->platformWindow->setGeometry(QRect(pos(), newSize)); + d->platformWindow->setGeometry(QRect(position(), newSize)); } else { d->geometry.setSize(newSize); } |