Fixed API in QWindow: visible() -> isVisible().

Change-Id: I14706abb8441c153f738563cb1a46205fdb2dae6
QWindow::visible() did not follow the API guidelines.
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
This commit is contained in:
Samuel Rødal 2012-02-17 10:19:35 +01:00 committed by Qt by Nokia
parent 64d06c1c67
commit f89d02e003
4 changed files with 14 additions and 6 deletions

View File

@ -1487,7 +1487,7 @@ bool QGuiApplicationPrivate::shouldQuit()
QWindowList list = QGuiApplication::topLevelWindows();
for (int i = 0; i < list.size(); ++i) {
QWindow *w = list.at(i);
if (w->visible())
if (w->isVisible())
return false;
}
return true;

View File

@ -93,7 +93,7 @@ QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
QWindowList list = QGuiApplication::topLevelWindows();
for (int i = list.size()-1; i >= 0; --i) {
QWindow *w = list[i];
if (w->visible() && w->geometry().contains(pos))
if (w->isVisible() && w->geometry().contains(pos))
return w;
}

View File

@ -185,7 +185,13 @@ void QWindow::setVisible(bool visible)
}
}
bool QWindow::visible() const
{
return isVisible();
}
bool QWindow::isVisible() const
{
Q_D(const QWindow);
@ -965,7 +971,7 @@ bool QWindow::event(QEvent *ev)
case QEvent::Close: {
Q_D(QWindow);
bool wasVisible = visible();
bool wasVisible = isVisible();
destroy();
if (wasVisible)
d->maybeQuitOnLastWindowClosed();
@ -1099,7 +1105,7 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
bool lastWindowClosed = true;
for (int i = 0; i < list.size(); ++i) {
QWindow *w = list.at(i);
if (!w->visible())
if (!w->isVisible())
continue;
lastWindowClosed = false;
break;

View File

@ -89,7 +89,7 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged)
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
public:
@ -101,7 +101,9 @@ public:
void setSurfaceType(SurfaceType surfaceType);
SurfaceType surfaceType() const;
bool visible() const;
QT_DEPRECATED bool visible() const;
bool isVisible() const;
void create();