Skip to content

Commit

Permalink
set focus in code editor when showing expression builder
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Nov 3, 2015
1 parent 1b435ed commit 1b170f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -622,6 +622,12 @@ void QgsExpressionBuilderWidget::loadExpressionContext()
}
}

void QgsExpressionBuilderWidget::showEvent( QShowEvent *e )
{
QWidget::showEvent( e );
txtExpressionString->setFocus();
}

void QgsExpressionBuilderWidget::on_txtSearchEdit_textChanged()
{
mProxyModel->setFilterWildcard( txtSearchEdit->text() );
Expand Down
4 changes: 3 additions & 1 deletion src/gui/qgsexpressionbuilderwidget.h
Expand Up @@ -259,6 +259,9 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
*/
void expressionParsed( bool isValid );

protected:
void showEvent( QShowEvent *e );

private:
void runPythonCode( const QString& code );
void updateFunctionTree();
Expand Down Expand Up @@ -288,7 +291,6 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
QString mRecentKey;
QMap<QString, QStringList> mFieldValues;
QgsExpressionContext mExpressionContext;

};

#endif // QGSEXPRESSIONBUILDER_H

0 comments on commit 1b170f9

Please sign in to comment.