Ignore key events in dialogs and let parent task panel handle them

The affected dialogs are:
* Texture mapping
* Cross-sections
* Extrusion
* Revolution
This commit is contained in:
wmayer
2018-09-13 11:13:33 +02:00
parent adb2fb6e04
commit aef87aeec5
8 changed files with 47 additions and 1 deletions

View File

@@ -34,6 +34,7 @@
# include <cfloat>
# include <QFuture>
# include <QFutureWatcher>
# include <QKeyEvent>
# include <QtConcurrentMap>
# include <boost/bind.hpp>
# include <Python.h>
@@ -176,6 +177,13 @@ void CrossSections::changeEvent(QEvent *e)
}
}
void CrossSections::keyPressEvent(QKeyEvent* ke)
{
// The cross-sections dialog is embedded into a task panel
// which is a parent widget and will handle the event
ke->ignore();
}
void CrossSections::accept()
{
apply();

View File

@@ -51,6 +51,7 @@ public:
protected:
void changeEvent(QEvent *e);
void keyPressEvent(QKeyEvent*);
private Q_SLOTS:
void on_xyPlane_clicked();

View File

@@ -34,6 +34,7 @@
# include <TopExp_Explorer.hxx>
# include <ShapeExtend_Explorer.hxx>
# include <TopTools_HSequenceOfShape.hxx>
# include <QKeyEvent>
# include <QMessageBox>
# include <Python.h>
# include <Inventor/system/inttypes.h>
@@ -147,6 +148,13 @@ void DlgExtrusion::changeEvent(QEvent *e)
QDialog::changeEvent(e);
}
void DlgExtrusion::keyPressEvent(QKeyEvent* ke)
{
// The extrusion dialog is embedded into a task panel
// which is a parent widget and will handle the event
ke->ignore();
}
void DlgExtrusion::on_rbDirModeCustom_toggled(bool on)
{
if(on) //this check prevents dual fire of dirmode changed - on radio buttons, one will come on, and other will come off, causing two events.

View File

@@ -65,6 +65,7 @@ protected:
void findShapes();
bool canExtrude(const TopoDS_Shape&) const;
void changeEvent(QEvent *e);
void keyPressEvent(QKeyEvent*);
private Q_SLOTS:
void on_rbDirModeCustom_toggled(bool on);

View File

@@ -315,6 +315,13 @@ void DlgRevolution::changeEvent(QEvent *e)
}
}
void DlgRevolution::keyPressEvent(QKeyEvent* ke)
{
// The revolution dialog is embedded into a task panel
// which is a parent widget and will handle the event
ke->ignore();
}
void DlgRevolution::findShapes()
{
App::Document* activeDoc = App::GetApplication().getActiveDocument();

View File

@@ -56,6 +56,7 @@ public:
protected:
void changeEvent(QEvent *e);
void keyPressEvent(QKeyEvent*);
private Q_SLOTS:
void on_selectLine_clicked();