Skip to content

Commit

Permalink
+ fixes #1517: Problem with constraint menu not displaying properly i…
Browse files Browse the repository at this point in the history
…f moved (overwrites the background)
  • Loading branch information
wwmayer committed May 3, 2014
1 parent adda1af commit cb720fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
8 changes: 3 additions & 5 deletions src/Mod/Sketcher/Gui/EditDatumDialog.cpp
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Sketcher/Gui/EditDatumDialog.h
Expand Up @@ -22,7 +22,7 @@
#ifndef SKETCHERGUI_EditDatumDialog_H
#define SKETCHERGUI_EditDatumDialog_H

class SoSensor;
#include <QObject>

namespace Sketcher {
class Constraint;
Expand All @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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"
}
}
Expand Down

0 comments on commit cb720fa

Please sign in to comment.