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/qgis@15855 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Apr 30, 2011
1 parent 8c0bef1 commit 68a0ea17d183b9dca19cfcbcedc01313cb886fe4
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 68a0ea1

Please sign in to comment.