From 4ebe4f4b727ee374fe5d5465f065ec1570fe3090 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Wed, 11 Jul 2018 15:35:16 +0200 Subject: [PATCH] Doc: Explain emission of QAction::changed on calling QAction::toggle Extend description of QAction::checked() and QAction::toggled(), as it is not clear from the documentation that calling QAction::toggle causes the emission of a QAction::changed signal. Task-number: QTBUG-68213 Change-Id: I5afa4d9a6e6f001dff81271d1e34d0c515da3c24 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qaction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 0ef4ed0634..8a359346c9 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -968,7 +968,10 @@ void QAction::toggle() Only checkable actions can be checked. By default, this is false (the action is unchecked). - \sa checkable + \note The notifier signal for this property is toggled(). As toggling + a QAction changes its state, it will also emit a changed() signal. + + \sa checkable, toggled() */ void QAction::setChecked(bool b) { @@ -1190,7 +1193,8 @@ void QAction::activate(ActionEvent event) This signal is emitted whenever a checkable action changes its isChecked() status. This can be the result of a user interaction, - or because setChecked() was called. + or because setChecked() was called. As setChecked() changes the + QAction, it emits changed() in addition to toggled(). \a checked is true if the action is checked, or false if the action is unchecked.