summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-09-01 14:35:54 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-09 10:09:15 +0000
commiteb5f1837547ee25794586741b710a7b7c74f0e20 (patch)
tree7a8a9adfcb4e2efb772a85306e6583464b3d42ba
parent259b3148ab9610d17c42f6aeef3ad01294fe9f03 (diff)
Add note to QMessageBox::button() about modifying returned button
We don't have a good way to detect whether the button is modified or not, to bail out of using the native dialog helpers. Document that this API shouldn't be used to modify the standard buttons (they are standard after all), and recommend the explicit APIs for adding custom buttons instead. Fixes: QTBUG-112525 Change-Id: I38c8ef5e1717a85f0db59c9e705d0775982ffb57 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit e9a1c53214d3936721e00bebbdc1e949e10658dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 9067b913aa..717d3675a0 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1007,6 +1007,12 @@ QMessageBox::StandardButton QMessageBox::standardButton(QAbstractButton *button)
Returns a pointer corresponding to the standard button \a which,
or \nullptr if the standard button doesn't exist in this message box.
+ \note Modifying the properties of the returned button may not be reflected
+ in native implementations of the message dialog. To customize dialog
+ buttons add a \l{addButton(QAbstractButton *button, QMessageBox::ButtonRole role)}
+ {custom button} or \l{addButton(const QString &text, QMessageBox::ButtonRole role)}
+ {button title} instead, or set the \l Option::DontUseNativeDialog option.
+
\sa standardButtons, standardButton()
*/
QAbstractButton *QMessageBox::button(StandardButton which) const