Skip to content

Commit

Permalink
Mac: Additional use of Qt non-native font dialog for 32-bit builds un…
Browse files Browse the repository at this point in the history
…til native QFontDialog bugs are fixed.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11287 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Aug 6, 2009
1 parent f69e26e commit f6e7882
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/composer/qgscomposerlabelwidget.cpp
Expand Up @@ -50,7 +50,12 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
if ( mComposerLabel )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this );
#endif
if ( ok )
{
mComposerLabel->setFont( newFont );
Expand Down
15 changes: 15 additions & 0 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -132,7 +132,12 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont(), this, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont() );
#endif
if ( ok )
{
mLegend->setTitleFont( newFont );
Expand All @@ -147,7 +152,12 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont(), this, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont() );
#endif
if ( ok )
{
mLegend->setLayerFont( newFont );
Expand All @@ -162,7 +172,12 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont(), this, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont() );
#endif
if ( ok )
{
mLegend->setItemFont( newFont );
Expand Down

0 comments on commit f6e7882

Please sign in to comment.