diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2023-09-06 14:30:24 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-09-07 14:36:46 +0000 |
commit | 28ab45182a3fea76193146083838cca4212395d2 (patch) | |
tree | 9104ecaffd62db5b04d4e6e3078c28e20ec514fd /src/plugins/platforms/cocoa | |
parent | bd9a32adca32c6ad36e6c42c08eed3e62e9f3490 (diff) |
macOS: Use non-native fallback for message boxes with rich text
The NSAlert messageText and informativeText properties only allow
plain NSString, so we need to opt out of the native dialog if the
user has requested rich text for any of these properties.
Fixes: QTBUG-116757
Change-Id: I3fd44ec94adad1dda1ed4dede46450a8a525d35f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoamessagedialog.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamessagedialog.mm b/src/plugins/platforms/cocoa/qcocoamessagedialog.mm index 56c3fceed2..c8c94b019d 100644 --- a/src/plugins/platforms/cocoa/qcocoamessagedialog.mm +++ b/src/plugins/platforms/cocoa/qcocoamessagedialog.mm @@ -91,6 +91,13 @@ bool QCocoaMessageDialog::show(Qt::WindowFlags windowFlags, Qt::WindowModality w if (!options()) return false; + if (Qt::mightBeRichText(options()->text()) || + Qt::mightBeRichText(options()->informativeText())) { + // Let's fallback to non-native message box, + // we only have plain NSString/text in NSAlert. + qCDebug(lcQpaDialogs, "Message box contains text in rich text format"); + return false; + } Q_ASSERT(!m_alert); m_alert = [NSAlert new]; |