Add missing notify signals for window title and icon changes.

Adds signals for changes to the window title, window icon and window
icon text.

Change-Id: Ia0ddcb94dda2c9ea790edc061d487765024191cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Richard J. Moore 2013-09-08 10:23:17 +01:00 committed by The Qt Project
parent 3bd73dd91f
commit 507a7b4df9
2 changed files with 39 additions and 3 deletions

View File

@ -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);
}

View File

@ -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: