diff options
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 33 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.h | 9 |
2 files changed, 39 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 5532b04b22..eea44300e8 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5601,6 +5601,15 @@ void QWidgetPrivate::setWindowIconText_helper(const QString &title) setWindowIconText_sys(qt_setWindowTitle_helperHelper(title, q)); } +/*! + \fn void QWidget::windowIconTextChanged(const QString &iconText) + + This signal is emitted when the window's icon text has changed, with the + new \a iconText as an argument. + + \since 5.2 +*/ + void QWidget::setWindowIconText(const QString &iconText) { if (QWidget::windowIconText() == iconText) @@ -5612,8 +5621,19 @@ void QWidget::setWindowIconText(const QString &iconText) QEvent e(QEvent::IconTextChange); QApplication::sendEvent(this, &e); + + emit windowIconTextChanged(iconText); } +/*! + \fn void QWidget::windowTitleChanged(const QString &title) + + This signal is emitted when the window's title has changed, with the + new \a title as an argument. + + \since 5.2 +*/ + void QWidget::setWindowTitle(const QString &title) { if (QWidget::windowTitle() == title && !title.isEmpty() && !title.isNull()) @@ -5625,6 +5645,8 @@ void QWidget::setWindowTitle(const QString &title) QEvent e(QEvent::WindowTitleChange); QApplication::sendEvent(this, &e); + + emit windowTitleChanged(title); } @@ -5661,6 +5683,15 @@ void QWidgetPrivate::setWindowIcon_helper() } } +/*! + \fn void QWidget::windowIconChanged(const QIcon &icon) + + This signal is emitted when the window's icon has changed, with the + new \a icon as an argument. + + \since 5.2 +*/ + void QWidget::setWindowIcon(const QIcon &icon) { Q_D(QWidget); @@ -5674,6 +5705,8 @@ void QWidget::setWindowIcon(const QIcon &icon) d->setWindowIcon_sys(); d->setWindowIcon_helper(); + + emit windowIconChanged(icon); } diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index f579dbb9cd..a9eeaa5470 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -171,9 +171,9 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice Q_PROPERTY(QSize sizeHint READ sizeHint) Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint) Q_PROPERTY(bool acceptDrops READ acceptDrops WRITE setAcceptDrops) - Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle DESIGNABLE isWindow) - Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon DESIGNABLE isWindow) - Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText DESIGNABLE isWindow) + Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle NOTIFY windowTitleChanged DESIGNABLE isWindow) + Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon NOTIFY windowIconChanged DESIGNABLE isWindow) + Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText NOTIFY windowIconTextChanged DESIGNABLE isWindow) Q_PROPERTY(double windowOpacity READ windowOpacity WRITE setWindowOpacity DESIGNABLE isWindow) Q_PROPERTY(bool windowModified READ isWindowModified WRITE setWindowModified DESIGNABLE isWindow) #ifndef QT_NO_TOOLTIP @@ -599,6 +599,9 @@ public: friend class QDesktopScreenWidget; Q_SIGNALS: + void windowTitleChanged(const QString &title); + void windowIconChanged(const QIcon &icon); + void windowIconTextChanged(const QString &iconText); void customContextMenuRequested(const QPoint &pos); protected: |