[QGIS Commit] r15323 - in trunk/qgis/src: app app/composer plugins/point_displacement_renderer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 3 13:33:46 EST 2011


Author: kyngchaos
Date: 2011-03-03 10:33:46 -0800 (Thu, 03 Mar 2011)
New Revision: 15323

Modified:
   trunk/qgis/src/app/composer/qgscomposerlabelwidget.cpp
   trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp
   trunk/qgis/src/app/composer/qgscomposermapwidget.cpp
   trunk/qgis/src/app/composer/qgscomposerscalebarwidget.cpp
   trunk/qgis/src/app/composer/qgscomposertablewidget.cpp
   trunk/qgis/src/app/qgslabeldialog.cpp
   trunk/qgis/src/app/qgslabelinggui.cpp
   trunk/qgis/src/app/qgslabelpropertydialog.cpp
   trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrendererwidget.cpp
Log:
use Qt font dialog for Qt Cocoa

Modified: trunk/qgis/src/app/composer/qgscomposerlabelwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposerlabelwidget.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/composer/qgscomposerlabelwidget.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -53,8 +53,8 @@
   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)
+#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, mComposerLabel->font(), this, QString(), QFontDialog::DontUseNativeDialog );
 #else
     QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this );

Modified: trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -169,8 +169,8 @@
   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)
+#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 );
 #else
     QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont() );
@@ -191,8 +191,8 @@
   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)
+#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 );
 #else
     QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont() );
@@ -213,8 +213,8 @@
   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)
+#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 );
 #else
     QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont() );
@@ -235,8 +235,8 @@
   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)
+#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 );
 #else
     QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont() );

Modified: trunk/qgis/src/app/composer/qgscomposermapwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposermapwidget.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/composer/qgscomposermapwidget.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -646,8 +646,8 @@
   }
 
   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)
+#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 );
 #else
   QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), this );

Modified: trunk/qgis/src/app/composer/qgscomposerscalebarwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposerscalebarwidget.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/composer/qgscomposerscalebarwidget.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -240,7 +240,12 @@
 
   bool dialogAccepted;
   QFont oldFont = mComposerScaleBar->font();
+#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( &dialogAccepted, oldFont, 0, QString(), QFontDialog::DontUseNativeDialog );
+#else
   QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0 );
+#endif
   if ( dialogAccepted )
   {
     mComposerScaleBar->beginCommand( tr( "Scalebar font changed" ) );

Modified: trunk/qgis/src/app/composer/qgscomposertablewidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposertablewidget.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/composer/qgscomposertablewidget.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -193,7 +193,12 @@
   }
 
   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, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
+#else
   QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ) );
+#endif
   if ( ok )
   {
     mComposerTable->beginCommand( tr( "Table header font" ) );
@@ -210,7 +215,12 @@
   }
 
   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, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
+#else
   QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ) );
+#endif
   if ( ok )
   {
     mComposerTable->beginCommand( tr( "Table content font" ) );

Modified: trunk/qgis/src/app/qgslabeldialog.cpp
===================================================================
--- trunk/qgis/src/app/qgslabeldialog.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/qgslabeldialog.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -281,8 +281,8 @@
 
   qreal fontSize = mFont.pointSizeF();
   bool resultFlag;
-#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)
+#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 );
 #else
   mFont = QFontDialog::getFont( &resultFlag, mFont, this );

Modified: trunk/qgis/src/app/qgslabelinggui.cpp
===================================================================
--- trunk/qgis/src/app/qgslabelinggui.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/qgslabelinggui.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -409,7 +409,12 @@
 void QgsLabelingGui::changeTextFont()
 {
   bool ok;
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QFont font = QFontDialog::getFont( &ok, lblFontPreview->font(), this, QString(), QFontDialog::DontUseNativeDialog );
+#else
   QFont font = QFontDialog::getFont( &ok, lblFontPreview->font(), this );
+#endif
   if ( ok )
   {
     updateFont( font );

Modified: trunk/qgis/src/app/qgslabelpropertydialog.cpp
===================================================================
--- trunk/qgis/src/app/qgslabelpropertydialog.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/app/qgslabelpropertydialog.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -249,7 +249,12 @@
 void QgsLabelPropertyDialog::on_mFontPushButton_clicked()
 {
   bool ok;
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ), QFontDialog::DontUseNativeDialog );
+#else
   mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ) );
+#endif
   if ( ok )
   {
     insertChangedValue( QgsPalLayerSettings::Size, mLabelFont.pointSizeF() );

Modified: trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrendererwidget.cpp
===================================================================
--- trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrendererwidget.cpp	2011-03-03 17:27:25 UTC (rev 15322)
+++ trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrendererwidget.cpp	2011-03-03 18:33:46 UTC (rev 15323)
@@ -203,7 +203,12 @@
   }
 
   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, mRenderer->labelFont(), 0, tr( "Label Font" ), QFontDialog::DontUseNativeDialog );
+#else
   QFont newFont = QFontDialog::getFont( &ok, mRenderer->labelFont(), 0, tr( "Label Font" ) );
+#endif
   if ( ok )
   {
     mRenderer->setLabelFont( newFont );



More information about the QGIS-commit mailing list