Merge branch 'master' into master
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
# include <BRepAdaptor_Curve.hxx>
|
||||
# include <Precision.hxx>
|
||||
|
||||
# include <QDebug>
|
||||
# include <QGraphicsScene>
|
||||
# include <QGraphicsSceneMouseEvent>
|
||||
# include <QPainter>
|
||||
@@ -48,7 +49,6 @@
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Parameter.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/Tools.h>
|
||||
#include <string>
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
#include "QGIViewDimension.h"
|
||||
#include "QGVPage.h"
|
||||
#include "MDIViewPage.h"
|
||||
#include "TaskBalloon.h"
|
||||
|
||||
//TODO: hide the Qt coord system (+y down).
|
||||
|
||||
@@ -140,8 +139,11 @@ void QGIBalloonLabel::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
|
||||
|
||||
void QGIBalloonLabel::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||
{
|
||||
if(scene() && this == scene()->mouseGrabberItem()) {
|
||||
Q_EMIT dragFinished();
|
||||
if (QLineF(event->screenPos(), event->buttonDownScreenPos(Qt::LeftButton))
|
||||
.length() > 0) {
|
||||
if (scene() && this == scene()->mouseGrabberItem()) {
|
||||
Q_EMIT dragFinished();
|
||||
}
|
||||
}
|
||||
m_ctrl = false;
|
||||
m_drag = false;
|
||||
@@ -152,13 +154,17 @@ void QGIBalloonLabel::mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event)
|
||||
{
|
||||
QGIViewBalloon* qgivBalloon = dynamic_cast<QGIViewBalloon*>(parentItem());
|
||||
if (qgivBalloon == nullptr) {
|
||||
qWarning() << "QGIBalloonLabel::mouseDoubleClickEvent: No parent item";
|
||||
return;
|
||||
}
|
||||
auto ViewProvider = static_cast<ViewProviderBalloon*>(qgivBalloon->getViewProvider(qgivBalloon->getViewObject()));
|
||||
|
||||
auto ViewProvider = dynamic_cast<ViewProviderBalloon*>(qgivBalloon->getViewProvider(qgivBalloon->getViewObject()));
|
||||
if (ViewProvider == nullptr) {
|
||||
qWarning() << "QGIBalloonLabel::mouseDoubleClickEvent: No valid view provider";
|
||||
return;
|
||||
}
|
||||
Gui::Control().showDialog(new TaskDlgBalloon(qgivBalloon, ViewProvider));
|
||||
|
||||
ViewProvider->startDefaultEditMode();
|
||||
QGraphicsItem::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
@@ -482,7 +488,7 @@ void QGIViewBalloon::balloonLabelDragged(bool ctrl)
|
||||
m_saveOffset = dvb->getOriginOffset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double scale = 1.0;
|
||||
DrawView* balloonParent = getSourceView();
|
||||
if (balloonParent != nullptr) {
|
||||
@@ -499,7 +505,7 @@ void QGIViewBalloon::balloonLabelDragged(bool ctrl)
|
||||
if (ctrl) {
|
||||
Base::Vector3d pos(x, -y, 0.0);
|
||||
Base::Vector3d newOrg = pos - m_saveOffset;
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.OriginX = %f",
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.OriginX = %f",
|
||||
dvb->getNameInDocument(), newOrg.x);
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.OriginY = %f",
|
||||
dvb->getNameInDocument(), newOrg.y);
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
# include <BRepAdaptor_Curve.hxx>
|
||||
# include <Precision.hxx>
|
||||
|
||||
# include <QApplication>
|
||||
# include <QDebug>
|
||||
# include <QGraphicsScene>
|
||||
# include <QGraphicsSceneMouseEvent>
|
||||
# include <QPainter>
|
||||
@@ -52,7 +54,6 @@
|
||||
#include <Base/Parameter.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Control.h>
|
||||
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
|
||||
@@ -76,7 +77,6 @@
|
||||
#include "QGIViewDimension.h"
|
||||
#include "ViewProviderDimension.h"
|
||||
#include "DrawGuiUtil.h"
|
||||
#include "TaskDimension.h"
|
||||
|
||||
#define NORMAL 0
|
||||
#define PRE 1
|
||||
@@ -149,10 +149,7 @@ void QGIDatumLabel::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||
m_ctrl = true;
|
||||
}
|
||||
|
||||
if(scene() && this == scene()->mouseGrabberItem()) {
|
||||
Q_EMIT dragFinished();
|
||||
}
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void QGIDatumLabel::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
|
||||
@@ -164,8 +161,11 @@ void QGIDatumLabel::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||
{
|
||||
// Base::Console().Message("QGIDL::mouseReleaseEvent()\n");
|
||||
m_ctrl = false;
|
||||
if(scene() && this == scene()->mouseGrabberItem()) {
|
||||
Q_EMIT dragFinished();
|
||||
if (QLineF(event->screenPos(), event->buttonDownScreenPos(Qt::LeftButton))
|
||||
.length() > 0) {
|
||||
if (scene() && this == scene()->mouseGrabberItem()) {
|
||||
Q_EMIT dragFinished();
|
||||
}
|
||||
}
|
||||
|
||||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
@@ -175,13 +175,17 @@ void QGIDatumLabel::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
QGIViewDimension* qgivDimension = dynamic_cast<QGIViewDimension*>(parentItem());
|
||||
if (qgivDimension == nullptr) {
|
||||
qWarning() << "QGIDatumLabel::mouseDoubleClickEvent: No parent item";
|
||||
return;
|
||||
}
|
||||
auto ViewProvider = static_cast<ViewProviderDimension*>(qgivDimension->getViewProvider(qgivDimension->getViewObject()));
|
||||
|
||||
auto ViewProvider = dynamic_cast<ViewProviderDimension*>(qgivDimension->getViewProvider(qgivDimension->getViewObject()));
|
||||
if (ViewProvider == nullptr) {
|
||||
qWarning() << "QGIDatumLabel::mouseDoubleClickEvent: No valid view provider";
|
||||
return;
|
||||
}
|
||||
Gui::Control().showDialog(new TaskDlgDimension(qgivDimension, ViewProvider));
|
||||
|
||||
ViewProvider->startDefaultEditMode();
|
||||
QGraphicsItem::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,14 +63,12 @@ public:
|
||||
virtual void unsetEdit(int ModNum);
|
||||
virtual bool doubleClicked(void);
|
||||
virtual bool canDelete(App::DocumentObject* obj) const;
|
||||
void startDefaultEditMode();
|
||||
|
||||
virtual TechDraw::DrawViewBalloon* getViewObject() const;
|
||||
|
||||
protected:
|
||||
virtual void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property * prop);
|
||||
|
||||
private:
|
||||
void startDefaultEditMode();
|
||||
};
|
||||
|
||||
} // namespace TechDrawGui
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
virtual bool setEdit(int ModNum);
|
||||
virtual void unsetEdit(int ModNum);
|
||||
virtual bool doubleClicked(void);
|
||||
void startDefaultEditMode();
|
||||
|
||||
virtual TechDraw::DrawViewDimension* getViewObject() const;
|
||||
|
||||
@@ -89,9 +90,6 @@ public:
|
||||
protected:
|
||||
virtual void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property * prop);
|
||||
|
||||
private:
|
||||
void startDefaultEditMode();
|
||||
|
||||
private:
|
||||
static const char *StandardAndStyleEnums[];
|
||||
static const char *RenderingExtentEnums[];
|
||||
|
||||
Reference in New Issue
Block a user