Add missing notify signal for the QWindow::title property
Similary to QWidget's windowTitleChanged, QWindow should also have a windowTitleChanges signal that's emitted when the title changed and declared as notify signal for the title property, so that QML bindings can be written against it. Change-Id: I6f107c6f0b43d6a959bc2ef96492e1f3e4c28bfe Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
parent
01a1f87368
commit
d2cb81f8d9
@ -727,9 +727,15 @@ Qt::WindowType QWindow::type() const
|
||||
void QWindow::setTitle(const QString &title)
|
||||
{
|
||||
Q_D(QWindow);
|
||||
bool changed = false;
|
||||
if (d->windowTitle != title) {
|
||||
d->windowTitle = title;
|
||||
changed = true;
|
||||
}
|
||||
if (d->platformWindow)
|
||||
d->platformWindow->setWindowTitle(title);
|
||||
if (changed)
|
||||
emit windowTitleChanged(title);
|
||||
}
|
||||
|
||||
QString QWindow::title() const
|
||||
|
@ -103,7 +103,7 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
|
||||
// C++ properties in qwindow.cpp AND as QML properties in qquickwindow.cpp.
|
||||
// http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-definetypes.html#type-revisions-and-versions
|
||||
|
||||
Q_PROPERTY(QString title READ title WRITE setTitle)
|
||||
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY windowTitleChanged)
|
||||
Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged)
|
||||
Q_PROPERTY(Qt::WindowFlags flags READ flags WRITE setFlags)
|
||||
Q_PROPERTY(int x READ x WRITE setX NOTIFY xChanged)
|
||||
@ -297,6 +297,7 @@ Q_SIGNALS:
|
||||
void screenChanged(QScreen *screen);
|
||||
void modalityChanged(Qt::WindowModality modality);
|
||||
void windowStateChanged(Qt::WindowState windowState);
|
||||
void windowTitleChanged(const QString &title);
|
||||
|
||||
void xChanged(int arg);
|
||||
void yChanged(int arg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user