[QGIS Commit] r15376 - in trunk/qgis/src: app gui/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Mar 7 00:12:50 EST 2011


Author: kyngchaos
Date: 2011-03-06 21:12:50 -0800 (Sun, 06 Mar 2011)
New Revision: 15376

Modified:
   trunk/qgis/src/app/qgssinglesymboldialog.cpp
   trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp
   trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
Log:
Use Qt color picker to avoid Qt Cocoa crashes (#3497), part 1

Modified: trunk/qgis/src/app/qgssinglesymboldialog.cpp
===================================================================
--- trunk/qgis/src/app/qgssinglesymboldialog.cpp	2011-03-06 23:15:18 UTC (rev 15375)
+++ trunk/qgis/src/app/qgssinglesymboldialog.cpp	2011-03-07 05:12:50 UTC (rev 15376)
@@ -252,7 +252,12 @@
 
 void QgsSingleSymbolDialog::selectOutlineColor()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor c = QColorDialog::getColor( btnOutlineColor->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor c = QColorDialog::getColor( btnOutlineColor->color(), this );
+#endif
 
   if ( c.isValid() )
   {
@@ -265,7 +270,12 @@
 
 void QgsSingleSymbolDialog::selectFillColor()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor c = QColorDialog::getColor( btnFillColor->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor c = QColorDialog::getColor( btnFillColor->color(), this );
+#endif
 
   if ( c.isValid() )
   {

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp	2011-03-06 23:15:18 UTC (rev 15375)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp	2011-03-07 05:12:50 UTC (rev 15376)
@@ -84,7 +84,12 @@
 
 void QgsSimpleLineSymbolLayerV2Widget::colorChanged()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mLayer->color(), this );
+#endif
   if ( !color.isValid() )
     return;
   mLayer->setColor( color );
@@ -226,7 +231,12 @@
 
 void QgsSimpleMarkerSymbolLayerV2Widget::setColorBorder()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor borderColor = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor borderColor = QColorDialog::getColor( mLayer->borderColor(), this );
+#endif
   if ( !borderColor.isValid() )
     return;
   mLayer->setBorderColor( borderColor );
@@ -236,7 +246,12 @@
 
 void QgsSimpleMarkerSymbolLayerV2Widget::setColorFill()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mLayer->color(), this );
+#endif
   if ( !color.isValid() )
     return;
   mLayer->setColor( color );
@@ -310,7 +325,12 @@
 
 void QgsSimpleFillSymbolLayerV2Widget::setColor()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mLayer->color(), this );
+#endif
   if ( !color.isValid() )
     return;
   mLayer->setColor( color );
@@ -320,7 +340,12 @@
 
 void QgsSimpleFillSymbolLayerV2Widget::setBorderColor()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mLayer->borderColor(), this );
+#endif
   if ( !color.isValid() )
     return;
   mLayer->setBorderColor( color );
@@ -638,7 +663,12 @@
 
 void QgsLineDecorationSymbolLayerV2Widget::colorChanged()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mLayer->color(), this );
+#endif
   if ( !color.isValid() )
     return;
   mLayer->setColor( color );
@@ -829,7 +859,12 @@
 
 void QgsFontMarkerSymbolLayerV2Widget::setColor()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mLayer->color(), this );
+#endif
   if ( !color.isValid() )
     return;
   mLayer->setColor( color );

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp	2011-03-06 23:15:18 UTC (rev 15375)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp	2011-03-07 05:12:50 UTC (rev 15376)
@@ -174,7 +174,12 @@
 
 void QgsSymbolV2SelectorDialog::setSymbolColor()
 {
+#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
+  // Native Mac dialog works only for Qt Carbon
+  QColor color = QColorDialog::getColor( mSymbol->color(), this, "", QColorDialog::DontUseNativeDialog );
+#else
   QColor color = QColorDialog::getColor( mSymbol->color(), this );
+#endif
   if ( !color.isValid() )
     return;
 



More information about the QGIS-commit mailing list