Skip to content

Commit

Permalink
Workaround for Mac Cocoa freeze when adding a stop to a gradient colo…
Browse files Browse the repository at this point in the history
…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 committed Apr 30, 2011
1 parent 16ab3c2 commit 3e74c57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp
Expand Up @@ -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;
Expand All @@ -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 );
Expand Down

0 comments on commit 3e74c57

Please sign in to comment.