Skip to content

Commit 62defb7

Browse files
author
jef
committed
remove Qt 4.5 dependency
git-svn-id: http://svn.osgeo.org/qgis/trunk@13371 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4e637e8 commit 62defb7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,19 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
126126
bool ok;
127127
double key = item->data( 0, StopOffsetRole ).toDouble();
128128
int val = ( int )( key * 100 );
129+
#if QT_VERSION >= 0x40500
129130
val = QInputDialog::getInt( this, tr( "Offset of the stop" ),
130131
tr( "Please enter offset in percents (%) of the new stop" ),
131132
val, 0, 100, 1, &ok );
133+
#else
134+
QString res = QInputDialog::getText( this, tr( "Offset of the stop" ),
135+
tr( "Please enter offset in percents (%) of the new stop" ),
136+
QLineEdit::Normal, QString::number( val ), &ok );
137+
if ( ok )
138+
val = res.toInt( &ok );
139+
if ( ok )
140+
ok = val >= 0 && val <= 100;
141+
#endif
132142
if ( !ok )
133143
return;
134144

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

150160
bool ok;
151161
int val = 50;
162+
#if QT_VERSION >= 0x40500
152163
val = QInputDialog::getInt( this, tr( "Offset of the stop" ),
153164
tr( "Please enter offset in percents (%) of the new stop" ),
154165
val, 0, 100, 1, &ok );
166+
#else
167+
QString res = QInputDialog::getText( this, tr( "Offset of the stop" ),
168+
tr( "Please enter offset in percents (%) of the new stop" ),
169+
QLineEdit::Normal, QString::number( val ), &ok );
170+
if ( ok )
171+
val = res.toInt( &ok );
172+
if ( ok )
173+
ok = val >= 0 && val <= 100;
174+
#endif
155175
if ( !ok )
156176
return;
157177

0 commit comments

Comments
 (0)