Skip to content
Permalink
Browse files

Workaround for Mac Cocoa freeze when adding a stop to a gradient colo…

…r ramp (call QColorDialog::getColor after QInputDialog::getInt instead of before).

git-svn-id: http://svn.osgeo.org/qgis/trunk@15855 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski
telwertowski committed Apr 30, 2011
1 parent 16ab3c2 commit 3e74c57fecf918648c0fd9d60ec1e02993e48549
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp
@@ -153,9 +153,13 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite

void QgsVectorGradientColorRampV2Dialog::addStop()
{
// Qt 4.7 Mac Cocoa bug: calling QInputDialog::getInt after QColorDialog::getColor will freeze app
// workaround: call QColorDialog::getColor below instead of here
#ifndef QT_MAC_USE_COCOA
QColor color = QColorDialog::getColor( QColor(), this );
if ( !color.isValid() )
return;
#endif

bool ok;
int val = 50;
@@ -175,6 +179,13 @@ void QgsVectorGradientColorRampV2Dialog::addStop()
if ( !ok )
return;

// Qt 4.7 Mac Cocoa bug workaround: call QColorDialog::getColor here instead of above
#ifdef QT_MAC_USE_COCOA
QColor color = QColorDialog::getColor( QColor(), this );
if ( !color.isValid() )
return;
#endif

double key = val / 100.0;
QStringList lst;
lst << "." << QString::number( val, 'f', 0 );

0 comments on commit 3e74c57

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