Fixed issue #841. Variables Table won't open again when closed with Esc.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-05-07 14:28:51 +03:00
parent 3b4007a40c
commit 8a255c063e
2 changed files with 15 additions and 0 deletions

View File

@ -212,6 +212,20 @@ void DialogTool::showEvent(QShowEvent *event)
ShowVisualization();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::keyPressEvent(QKeyEvent *event)
{
switch (event->key())
{
case Qt::Key_Escape:
DialogRejected();
return; // After reject the dialog will be destroyed, exit imidiately
default:
break;
}
QDialog::keyPressEvent ( event );
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxPiecesList(QComboBox *box, const QVector<quint32> &list)
{

View File

@ -205,6 +205,7 @@ protected:
virtual void closeEvent ( QCloseEvent * event ) Q_DECL_OVERRIDE;
virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
void FillComboBoxPiecesList(QComboBox *box, const QVector<quint32> &list);
void FillComboBoxPoints(QComboBox *box, FillComboBox rule = FillComboBox::Whole,