Skip to content

Commit 68a0ea1

Browse files
author
telwertowski
committed
Workaround for Mac Cocoa freeze when adding a stop to a gradient color 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
1 parent 8c0bef1 commit 68a0ea1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,13 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
153153

154154
void QgsVectorGradientColorRampV2Dialog::addStop()
155155
{
156+
// Qt 4.7 Mac Cocoa bug: calling QInputDialog::getInt after QColorDialog::getColor will freeze app
157+
// workaround: call QColorDialog::getColor below instead of here
158+
#ifndef QT_MAC_USE_COCOA
156159
QColor color = QColorDialog::getColor( QColor(), this );
157160
if ( !color.isValid() )
158161
return;
162+
#endif
159163

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

182+
// Qt 4.7 Mac Cocoa bug workaround: call QColorDialog::getColor here instead of above
183+
#ifdef QT_MAC_USE_COCOA
184+
QColor color = QColorDialog::getColor( QColor(), this );
185+
if ( !color.isValid() )
186+
return;
187+
#endif
188+
178189
double key = val / 100.0;
179190
QStringList lst;
180191
lst << "." << QString::number( val, 'f', 0 );

0 commit comments

Comments
 (0)