Skip to content

Commit

Permalink
Gui: automatically activate the DlgExpressionInput dialog; fixes #4384
Browse files Browse the repository at this point in the history
  • Loading branch information
zaphodbe authored and wwmayer committed Sep 4, 2020
1 parent 685fc40 commit 4cfefb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Gui/DlgExpressionInput.cpp
Expand Up @@ -107,7 +107,6 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path,
this->resize(ui->expression->width()+18,this->height());
}
ui->expression->setFocus();
ui->expression->activateWindow();
}

DlgExpressionInput::~DlgExpressionInput()
Expand Down Expand Up @@ -268,6 +267,13 @@ void DlgExpressionInput::mousePressEvent(QMouseEvent* ev)
}
}

void DlgExpressionInput::show()
{
QDialog::show();
this->activateWindow();
ui->expression->selectAll();
}

void DlgExpressionInput::showEvent(QShowEvent* ev)
{
QDialog::showEvent(ev);
Expand Down
3 changes: 3 additions & 0 deletions src/Gui/DlgExpressionInput.h
Expand Up @@ -63,6 +63,9 @@ class GuiExport DlgExpressionInput : public QDialog

bool eventFilter(QObject *obj, QEvent *event);

public Q_SLOTS:
void show();

protected:
void showEvent(QShowEvent*);
void mouseReleaseEvent(QMouseEvent*);
Expand Down

0 comments on commit 4cfefb1

Please sign in to comment.