Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove Qt 4.5 dependency
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13371 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 24, 2010
1 parent 071ab66 commit 53e5012
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp
Expand Up @@ -126,9 +126,19 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
bool ok;
double key = item->data( 0, StopOffsetRole ).toDouble();
int val = ( int )( key * 100 );
#if QT_VERSION >= 0x40500
val = QInputDialog::getInt( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
val, 0, 100, 1, &ok );
#else
QString res = QInputDialog::getText( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
QLineEdit::Normal, QString::number( val ), &ok );
if ( ok )
val = res.toInt( &ok );
if ( ok )
ok = val >= 0 && val <= 100;
#endif
if ( !ok )
return;

Expand All @@ -149,9 +159,19 @@ void QgsVectorGradientColorRampV2Dialog::addStop()

bool ok;
int val = 50;
#if QT_VERSION >= 0x40500
val = QInputDialog::getInt( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
val, 0, 100, 1, &ok );
#else
QString res = QInputDialog::getText( this, tr( "Offset of the stop" ),
tr( "Please enter offset in percents (%) of the new stop" ),
QLineEdit::Normal, QString::number( val ), &ok );
if ( ok )
val = res.toInt( &ok );
if ( ok )
ok = val >= 0 && val <= 100;
#endif
if ( !ok )
return;

Expand Down

0 comments on commit 53e5012

Please sign in to comment.