From 4cfefb19386cd7241da09e9b9523c57bb4e4cdd6 Mon Sep 17 00:00:00 2001 From: Christopher Coley Date: Wed, 15 Jul 2020 02:38:16 -0700 Subject: [PATCH] Gui: automatically activate the DlgExpressionInput dialog; fixes #4384 --- src/Gui/DlgExpressionInput.cpp | 8 +++++++- src/Gui/DlgExpressionInput.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Gui/DlgExpressionInput.cpp b/src/Gui/DlgExpressionInput.cpp index d2965e0b0d..637b27e5e4 100644 --- a/src/Gui/DlgExpressionInput.cpp +++ b/src/Gui/DlgExpressionInput.cpp @@ -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() @@ -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); diff --git a/src/Gui/DlgExpressionInput.h b/src/Gui/DlgExpressionInput.h index 90cd6feccf..c6d6d5c34a 100644 --- a/src/Gui/DlgExpressionInput.h +++ b/src/Gui/DlgExpressionInput.h @@ -63,6 +63,9 @@ public: bool eventFilter(QObject *obj, QEvent *event); +public Q_SLOTS: + void show(); + protected: void showEvent(QShowEvent*); void mouseReleaseEvent(QMouseEvent*);