+ fixes #0001517: Problem with constraint menu not displaying properly if moved (overwrites the background)
This commit is contained in:
parent
adda1afc4c
commit
cb720fae50
|
@ -62,12 +62,10 @@ EditDatumDialog::EditDatumDialog(Sketcher::SketchObject* pcSketch, int ConstrNbr
|
||||||
|
|
||||||
EditDatumDialog::~EditDatumDialog(){}
|
EditDatumDialog::~EditDatumDialog(){}
|
||||||
|
|
||||||
void EditDatumDialog::run(void * data, SoSensor * sensor)
|
void EditDatumDialog::customEvent(QEvent*)
|
||||||
{
|
{
|
||||||
EditDatumDialog* self = reinterpret_cast<EditDatumDialog*>(data);
|
this->exec();
|
||||||
self->exec();
|
this->deleteLater();
|
||||||
delete self;
|
|
||||||
delete sensor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditDatumDialog::exec(bool atCursor)
|
void EditDatumDialog::exec(bool atCursor)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#ifndef SKETCHERGUI_EditDatumDialog_H
|
#ifndef SKETCHERGUI_EditDatumDialog_H
|
||||||
#define SKETCHERGUI_EditDatumDialog_H
|
#define SKETCHERGUI_EditDatumDialog_H
|
||||||
|
|
||||||
class SoSensor;
|
#include <QObject>
|
||||||
|
|
||||||
namespace Sketcher {
|
namespace Sketcher {
|
||||||
class Constraint;
|
class Constraint;
|
||||||
|
@ -32,15 +32,15 @@ class SketchObject;
|
||||||
namespace SketcherGui {
|
namespace SketcherGui {
|
||||||
class ViewProviderSketch;
|
class ViewProviderSketch;
|
||||||
|
|
||||||
class EditDatumDialog {
|
class EditDatumDialog : public QObject {
|
||||||
Q_DECLARE_TR_FUNCTIONS(SketcherGui::EditDatumDialog)
|
Q_DECLARE_TR_FUNCTIONS(SketcherGui::EditDatumDialog)
|
||||||
public:
|
public:
|
||||||
EditDatumDialog(ViewProviderSketch* vp, int ConstrNbr);
|
EditDatumDialog(ViewProviderSketch* vp, int ConstrNbr);
|
||||||
EditDatumDialog(Sketcher::SketchObject* pcSketch, int ConstrNbr);
|
EditDatumDialog(Sketcher::SketchObject* pcSketch, int ConstrNbr);
|
||||||
~EditDatumDialog();
|
~EditDatumDialog();
|
||||||
|
|
||||||
static void run(void * data, SoSensor * sensor);
|
|
||||||
void exec(bool atCursor=true);
|
void exec(bool atCursor=true);
|
||||||
|
void customEvent(QEvent*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Sketcher::SketchObject* sketch;
|
Sketcher::SketchObject* sketch;
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
# include <Inventor/nodes/SoText2.h>
|
# include <Inventor/nodes/SoText2.h>
|
||||||
# include <Inventor/nodes/SoFont.h>
|
# include <Inventor/nodes/SoFont.h>
|
||||||
# include <Inventor/nodes/SoPickStyle.h>
|
# include <Inventor/nodes/SoPickStyle.h>
|
||||||
# include <Inventor/sensors/SoIdleSensor.h>
|
|
||||||
# include <Inventor/nodes/SoCamera.h>
|
# include <Inventor/nodes/SoCamera.h>
|
||||||
|
|
||||||
/// Qt Include Files
|
/// Qt Include Files
|
||||||
|
@ -876,9 +875,9 @@ void ViewProviderSketch::editDoubleClicked(void)
|
||||||
Constr->Type == Sketcher::DistanceX || Constr->Type == Sketcher::DistanceY ||
|
Constr->Type == Sketcher::DistanceX || Constr->Type == Sketcher::DistanceY ||
|
||||||
Constr->Type == Sketcher::Radius || Constr->Type == Sketcher::Angle) {
|
Constr->Type == Sketcher::Radius || Constr->Type == Sketcher::Angle) {
|
||||||
|
|
||||||
|
// Coin's SoIdleSensor causes problems on some platform while Qt seems to work properly (#0001517)
|
||||||
EditDatumDialog * editDatumDialog = new EditDatumDialog(this, edit->PreselectConstraint);
|
EditDatumDialog * editDatumDialog = new EditDatumDialog(this, edit->PreselectConstraint);
|
||||||
SoIdleSensor* sensor = new SoIdleSensor(EditDatumDialog::run, editDatumDialog);
|
QCoreApplication::postEvent(editDatumDialog, new QEvent(QEvent::User));
|
||||||
sensor->schedule();
|
|
||||||
edit->editDatumDialog = true; // avoid to double handle "ESC"
|
edit->editDatumDialog = true; // avoid to double handle "ESC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user