From 672e7c875e8680818e23d0aef98129d95eb7e91c Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 22 Oct 2012 17:06:23 +0200 Subject: Remove QWindow pos, geometry and size as properties; pos->position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qwindow.cpp | 51 ++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) (limited to 'src/gui/kernel/qwindow.cpp') 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); } -- cgit v1.2.3