Skip to content

Commit ca4c98e

Browse files
author
telwertowski
committed
Mac: Additional use of Qt non-native font dialog for 32-bit builds until native QFontDialog bugs are fixed.
git-svn-id: http://svn.osgeo.org/qgis/trunk@11287 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9a364a6 commit ca4c98e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/app/composer/qgscomposerlabelwidget.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
5050
if ( mComposerLabel )
5151
{
5252
bool ok;
53+
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
54+
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
55+
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this, QString(), QFontDialog::DontUseNativeDialog );
56+
#else
5357
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this );
58+
#endif
5459
if ( ok )
5560
{
5661
mComposerLabel->setFont( newFont );

src/app/composer/qgscomposerlegendwidget.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
132132
if ( mLegend )
133133
{
134134
bool ok;
135+
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
136+
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
137+
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont(), this, QString(), QFontDialog::DontUseNativeDialog );
138+
#else
135139
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont() );
140+
#endif
136141
if ( ok )
137142
{
138143
mLegend->setTitleFont( newFont );
@@ -147,7 +152,12 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
147152
if ( mLegend )
148153
{
149154
bool ok;
155+
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
156+
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
157+
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont(), this, QString(), QFontDialog::DontUseNativeDialog );
158+
#else
150159
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont() );
160+
#endif
151161
if ( ok )
152162
{
153163
mLegend->setLayerFont( newFont );
@@ -162,7 +172,12 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
162172
if ( mLegend )
163173
{
164174
bool ok;
175+
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && !defined(__LP64__)
176+
// Native Mac dialog works only for 64 bit Cocoa (observed in Qt 4.5.2, probably a Qt bug)
177+
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont(), this, QString(), QFontDialog::DontUseNativeDialog );
178+
#else
165179
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont() );
180+
#endif
166181
if ( ok )
167182
{
168183
mLegend->setItemFont( newFont );

0 commit comments

Comments
 (0)