Skip to content

Commit e1dc810

Browse files
committed
Also set focus to text box after double clicking lists in vector field dialog
1 parent 0a7da31 commit e1dc810

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/gui/qgsquerybuilder.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -250,36 +250,43 @@ void QgsQueryBuilder::reject()
250250
void QgsQueryBuilder::on_btnEqual_clicked()
251251
{
252252
txtSQL->insertPlainText( " = " );
253+
txtSQL->setFocus();
253254
}
254255

255256
void QgsQueryBuilder::on_btnLessThan_clicked()
256257
{
257258
txtSQL->insertPlainText( " < " );
259+
txtSQL->setFocus();
258260
}
259261

260262
void QgsQueryBuilder::on_btnGreaterThan_clicked()
261263
{
262264
txtSQL->insertPlainText( " > " );
265+
txtSQL->setFocus();
263266
}
264267

265268
void QgsQueryBuilder::on_btnPct_clicked()
266269
{
267270
txtSQL->insertPlainText( "%" );
271+
txtSQL->setFocus();
268272
}
269273

270274
void QgsQueryBuilder::on_btnIn_clicked()
271275
{
272276
txtSQL->insertPlainText( " IN " );
277+
txtSQL->setFocus();
273278
}
274279

275280
void QgsQueryBuilder::on_btnNotIn_clicked()
276281
{
277282
txtSQL->insertPlainText( " NOT IN " );
283+
txtSQL->setFocus();
278284
}
279285

280286
void QgsQueryBuilder::on_btnLike_clicked()
281287
{
282288
txtSQL->insertPlainText( " LIKE " );
289+
txtSQL->setFocus();
283290
}
284291

285292
QString QgsQueryBuilder::sql()
@@ -308,6 +315,7 @@ void QgsQueryBuilder::on_lstFields_clicked( const QModelIndex &index )
308315
void QgsQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )
309316
{
310317
txtSQL->insertPlainText( "\"" + mLayer->pendingFields()[ mModelFields->data( index, Qt::UserRole+1 ).toInt()].name() + "\"" );
318+
txtSQL->setFocus();
311319
}
312320

313321
void QgsQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )
@@ -321,36 +329,44 @@ void QgsQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )
321329
txtSQL->insertPlainText( value.toString() );
322330
else
323331
txtSQL->insertPlainText( "'" + value.toString().replace( "'", "''" ) + "'" );
332+
333+
txtSQL->setFocus();
324334
}
325335

326336
void QgsQueryBuilder::on_btnLessEqual_clicked()
327337
{
328338
txtSQL->insertPlainText( " <= " );
339+
txtSQL->setFocus();
329340
}
330341

331342
void QgsQueryBuilder::on_btnGreaterEqual_clicked()
332343
{
333344
txtSQL->insertPlainText( " >= " );
345+
txtSQL->setFocus();
334346
}
335347

336348
void QgsQueryBuilder::on_btnNotEqual_clicked()
337349
{
338350
txtSQL->insertPlainText( " != " );
351+
txtSQL->setFocus();
339352
}
340353

341354
void QgsQueryBuilder::on_btnAnd_clicked()
342355
{
343356
txtSQL->insertPlainText( " AND " );
357+
txtSQL->setFocus();
344358
}
345359

346360
void QgsQueryBuilder::on_btnNot_clicked()
347361
{
348362
txtSQL->insertPlainText( " NOT " );
363+
txtSQL->setFocus();
349364
}
350365

351366
void QgsQueryBuilder::on_btnOr_clicked()
352367
{
353368
txtSQL->insertPlainText( " OR " );
369+
txtSQL->setFocus();
354370
}
355371

356372
void QgsQueryBuilder::clear()
@@ -363,6 +379,7 @@ void QgsQueryBuilder::clear()
363379
void QgsQueryBuilder::on_btnILike_clicked()
364380
{
365381
txtSQL->insertPlainText( " ILIKE " );
382+
txtSQL->setFocus();
366383
}
367384

368385
void QgsQueryBuilder::setDatasourceDescription( QString uri )

0 commit comments

Comments
 (0)