Skip to content

Commit 930c56f

Browse files
iona5PeterPetrik
authored andcommittedDec 4, 2018
workaround broken QFontDialog on macOS with Qt5 (Fixes #20426)
QFontDialog using the native dialog is broken in some versions of Qt5 on macOS, see - https://bugreports.qt.io/browse/QTBUG-69878 - https://successfulsoftware.net/2018/11/02/qt-is-broken-on-macos-right-now/ this breaks QgsFontButton in ModeQFont. When opening the dialog it will not change the format after accepting. normally our code wouldn't use the native dialog on macOS anyway, but due to using an outdated preprocessor check it was exhibiting the broken behavior. this patch restores the usage of a non-native font dialog on macOS. discussions: - https://issues.qgis.org/issues/20426 - #8585
1 parent a1dbb96 commit 930c56f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎src/gui/qgsguiutils.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,12 @@ namespace QgsGuiUtils
195195
// parent is intentionally not set to 'this' as
196196
// that would make it follow the style sheet font
197197
// see also #12233 and #4937
198-
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
199-
// Native Mac dialog works only for Qt Carbon
200-
return QFontDialog::getFont( &ok, initial, 0, title, QFontDialog::DontUseNativeDialog );
198+
#if defined(Q_OS_MAC)
199+
// Native dialog broken on macOS with Qt5
200+
// probably only broken in Qt5.11.1 and .2
201+
// (see https://successfulsoftware.net/2018/11/02/qt-is-broken-on-macos-right-now/ )
202+
// possible upstream bug: https://bugreports.qt.io/browse/QTBUG-69878 (fixed in Qt 5.12 ?)
203+
return QFontDialog::getFont( &ok, initial, nullptr, title, QFontDialog::DontUseNativeDialog );
201204
#else
202205
return QFontDialog::getFont( &ok, initial, nullptr, title );
203206
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.