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:
parent
64d06c1c67
commit
f89d02e003
@ -1487,7 +1487,7 @@ bool QGuiApplicationPrivate::shouldQuit()
|
|||||||
QWindowList list = QGuiApplication::topLevelWindows();
|
QWindowList list = QGuiApplication::topLevelWindows();
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
QWindow *w = list.at(i);
|
QWindow *w = list.at(i);
|
||||||
if (w->visible())
|
if (w->isVisible())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -93,7 +93,7 @@ QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
|
|||||||
QWindowList list = QGuiApplication::topLevelWindows();
|
QWindowList list = QGuiApplication::topLevelWindows();
|
||||||
for (int i = list.size()-1; i >= 0; --i) {
|
for (int i = list.size()-1; i >= 0; --i) {
|
||||||
QWindow *w = list[i];
|
QWindow *w = list[i];
|
||||||
if (w->visible() && w->geometry().contains(pos))
|
if (w->isVisible() && w->geometry().contains(pos))
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,13 @@ void QWindow::setVisible(bool visible)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool QWindow::visible() const
|
bool QWindow::visible() const
|
||||||
|
{
|
||||||
|
return isVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QWindow::isVisible() const
|
||||||
{
|
{
|
||||||
Q_D(const QWindow);
|
Q_D(const QWindow);
|
||||||
|
|
||||||
@ -965,7 +971,7 @@ bool QWindow::event(QEvent *ev)
|
|||||||
|
|
||||||
case QEvent::Close: {
|
case QEvent::Close: {
|
||||||
Q_D(QWindow);
|
Q_D(QWindow);
|
||||||
bool wasVisible = visible();
|
bool wasVisible = isVisible();
|
||||||
destroy();
|
destroy();
|
||||||
if (wasVisible)
|
if (wasVisible)
|
||||||
d->maybeQuitOnLastWindowClosed();
|
d->maybeQuitOnLastWindowClosed();
|
||||||
@ -1099,7 +1105,7 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
|
|||||||
bool lastWindowClosed = true;
|
bool lastWindowClosed = true;
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
QWindow *w = list.at(i);
|
QWindow *w = list.at(i);
|
||||||
if (!w->visible())
|
if (!w->isVisible())
|
||||||
continue;
|
continue;
|
||||||
lastWindowClosed = false;
|
lastWindowClosed = false;
|
||||||
break;
|
break;
|
||||||
|
@ -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 y READ y WRITE setY NOTIFY yChanged)
|
||||||
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
|
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
|
||||||
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
|
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)
|
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -101,7 +101,9 @@ public:
|
|||||||
void setSurfaceType(SurfaceType surfaceType);
|
void setSurfaceType(SurfaceType surfaceType);
|
||||||
SurfaceType surfaceType() const;
|
SurfaceType surfaceType() const;
|
||||||
|
|
||||||
bool visible() const;
|
QT_DEPRECATED bool visible() const;
|
||||||
|
|
||||||
|
bool isVisible() const;
|
||||||
|
|
||||||
void create();
|
void create();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user