+ fixes #0001517: Problem with constraint menu not displaying properly if moved (overwrites the background)

This commit is contained in:
wmayer 2014-05-03 23:39:04 +02:00
parent adda1afc4c
commit cb720fae50
3 changed files with 8 additions and 11 deletions

View File

@ -62,12 +62,10 @@ EditDatumDialog::EditDatumDialog(Sketcher::SketchObject* pcSketch, int ConstrNbr
EditDatumDialog::~EditDatumDialog(){}
void EditDatumDialog::run(void * data, SoSensor * sensor)
void EditDatumDialog::customEvent(QEvent*)
{
EditDatumDialog* self = reinterpret_cast<EditDatumDialog*>(data);
self->exec();
delete self;
delete sensor;
this->exec();
this->deleteLater();
}
void EditDatumDialog::exec(bool atCursor)

View File

@ -22,7 +22,7 @@
#ifndef SKETCHERGUI_EditDatumDialog_H
#define SKETCHERGUI_EditDatumDialog_H
class SoSensor;
#include <QObject>
namespace Sketcher {
class Constraint;
@ -32,15 +32,15 @@ class SketchObject;
namespace SketcherGui {
class ViewProviderSketch;
class EditDatumDialog {
class EditDatumDialog : public QObject {
Q_DECLARE_TR_FUNCTIONS(SketcherGui::EditDatumDialog)
public:
EditDatumDialog(ViewProviderSketch* vp, int ConstrNbr);
EditDatumDialog(Sketcher::SketchObject* pcSketch, int ConstrNbr);
~EditDatumDialog();
static void run(void * data, SoSensor * sensor);
void exec(bool atCursor=true);
void customEvent(QEvent*);
private:
Sketcher::SketchObject* sketch;

View File

@ -52,7 +52,6 @@
# include <Inventor/nodes/SoText2.h>
# include <Inventor/nodes/SoFont.h>
# include <Inventor/nodes/SoPickStyle.h>
# include <Inventor/sensors/SoIdleSensor.h>
# include <Inventor/nodes/SoCamera.h>
/// Qt Include Files
@ -876,9 +875,9 @@ void ViewProviderSketch::editDoubleClicked(void)
Constr->Type == Sketcher::DistanceX || Constr->Type == Sketcher::DistanceY ||
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);
SoIdleSensor* sensor = new SoIdleSensor(EditDatumDialog::run, editDatumDialog);
sensor->schedule();
QCoreApplication::postEvent(editDatumDialog, new QEvent(QEvent::User));
edit->editDatumDialog = true; // avoid to double handle "ESC"
}
}