@@ -126,9 +126,19 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
126
126
bool ok;
127
127
double key = item->data ( 0 , StopOffsetRole ).toDouble ();
128
128
int val = ( int )( key * 100 );
129
+ #if QT_VERSION >= 0x40500
129
130
val = QInputDialog::getInt ( this , tr ( " Offset of the stop" ),
130
131
tr ( " Please enter offset in percents (%) of the new stop" ),
131
132
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
132
142
if ( !ok )
133
143
return ;
134
144
@@ -149,9 +159,19 @@ void QgsVectorGradientColorRampV2Dialog::addStop()
149
159
150
160
bool ok;
151
161
int val = 50 ;
162
+ #if QT_VERSION >= 0x40500
152
163
val = QInputDialog::getInt ( this , tr ( " Offset of the stop" ),
153
164
tr ( " Please enter offset in percents (%) of the new stop" ),
154
165
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
155
175
if ( !ok )
156
176
return ;
157
177
0 commit comments