Skip to content

Commit 1b170f9

Browse files
committedNov 3, 2015
set focus in code editor when showing expression builder
1 parent 1b435ed commit 1b170f9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎src/gui/qgsexpressionbuilderwidget.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,12 @@ void QgsExpressionBuilderWidget::loadExpressionContext()
622622
}
623623
}
624624

625+
void QgsExpressionBuilderWidget::showEvent( QShowEvent *e )
626+
{
627+
QWidget::showEvent( e );
628+
txtExpressionString->setFocus();
629+
}
630+
625631
void QgsExpressionBuilderWidget::on_txtSearchEdit_textChanged()
626632
{
627633
mProxyModel->setFilterWildcard( txtSearchEdit->text() );

‎src/gui/qgsexpressionbuilderwidget.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
259259
*/
260260
void expressionParsed( bool isValid );
261261

262+
protected:
263+
void showEvent( QShowEvent *e );
264+
262265
private:
263266
void runPythonCode( const QString& code );
264267
void updateFunctionTree();
@@ -288,7 +291,6 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
288291
QString mRecentKey;
289292
QMap<QString, QStringList> mFieldValues;
290293
QgsExpressionContext mExpressionContext;
291-
292294
};
293295

294296
#endif // QGSEXPRESSIONBUILDER_H

0 commit comments

Comments
 (0)
Please sign in to comment.