Skip to content
Permalink
Browse files

Update for issue #5692

- Qt font dialog on Mac inherits app font if app is in ancestry (make dialog parentless)
  • Loading branch information
dakcarto committed Oct 3, 2012
1 parent abcc4bf commit d8c7c15fa32e0a7e9439671bc349eb5605d3375f
@@ -85,10 +85,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QSettings settings;
int size = settings.value( "/IconSize", QGIS_ICON_SIZE ).toInt();
setIconSize( QSize( size, size ) );

#ifndef Q_WS_MAC
setFontSize( settings.value( "/fontPointSize", QGIS_DEFAULT_FONTSIZE ).toInt() );
#endif

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
@@ -209,7 +209,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont() );
#endif
@@ -231,7 +231,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont() );
#endif
@@ -253,7 +253,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont() );
#endif
@@ -275,7 +275,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont() );
#endif
@@ -749,7 +749,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont() );
#endif
@@ -277,7 +277,7 @@ void QgsDecorationGridDialog::on_mAnnotationFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont() );
#endif
@@ -282,9 +282,9 @@ void QgsLabelDialog::changeFont( void )
bool resultFlag;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
mFont = QFontDialog::getFont( &resultFlag, mFont, this, QString(), QFontDialog::DontUseNativeDialog );
mFont = QFontDialog::getFont( &resultFlag, mFont, 0, QString(), QFontDialog::DontUseNativeDialog );
#else
mFont = QFontDialog::getFont( &resultFlag, mFont, this );
mFont = QFontDialog::getFont( &resultFlag, mFont);
#endif
if ( !resultFlag )
return;

0 comments on commit d8c7c15

Please sign in to comment.
You can’t perform that action at this time.