/QGI/QGraphicsItem/
This commit is contained in:
parent
9062b7e727
commit
a9d6f1568b
|
@ -43,11 +43,11 @@ using namespace TechDrawGui;
|
||||||
QGCustomClip::QGCustomClip()
|
QGCustomClip::QGCustomClip()
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false); //not sure if needs to handle events for Views in Group???
|
setHandlesChildEvents(false); //not sure if needs to handle events for Views in Group???
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(false);
|
setAcceptHoverEvents(false);
|
||||||
setFlag(QGI::ItemIsSelectable, false);
|
setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||||
setFlag(QGI::ItemIsMovable, false);
|
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||||
setFlag(QGI::ItemClipsChildrenToShape, true);
|
setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
|
||||||
m_rect = QRectF(0.,0.,10.,10.);
|
m_rect = QRectF(0.,0.,10.,10.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ void QGCustomClip::paint ( QPainter * painter, const QStyleOptionGraphicsItem *
|
||||||
QStyleOptionGraphicsItem myOption(*option);
|
QStyleOptionGraphicsItem myOption(*option);
|
||||||
myOption.state &= ~QStyle::State_Selected;
|
myOption.state &= ~QStyle::State_Selected;
|
||||||
|
|
||||||
QGIGroup::paint (painter, &myOption, widget);
|
QGraphicsItemGroup::paint (painter, &myOption, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF QGCustomClip::boundingRect() const //sb shape()?
|
QRectF QGCustomClip::boundingRect() const //sb shape()?
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGCUSTOMCLIP_H
|
#ifndef DRAWINGGUI_QGCUSTOMCLIP_H
|
||||||
#define DRAWINGGUI_QGCUSTOMCLIP_H
|
#define DRAWINGGUI_QGCUSTOMCLIP_H
|
||||||
|
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ QT_END_NAMESPACE
|
||||||
namespace TechDrawGui
|
namespace TechDrawGui
|
||||||
{
|
{
|
||||||
|
|
||||||
class TechDrawGuiExport QGCustomClip : public QGIGroup
|
class TechDrawGuiExport QGCustomClip : public QGraphicsItemGroup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QGCustomClip(void);
|
explicit QGCustomClip(void);
|
||||||
~QGCustomClip() {}
|
~QGCustomClip() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 132};
|
enum {Type = QGraphicsItem::UserType + 132};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
virtual QRectF boundingRect() const;
|
virtual QRectF boundingRect() const;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ using namespace TechDrawGui;
|
||||||
|
|
||||||
QGCustomRect::QGCustomRect()
|
QGCustomRect::QGCustomRect()
|
||||||
{
|
{
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGCustomRect::centerAt(QPointF centerPos)
|
void QGCustomRect::centerAt(QPointF centerPos)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGCUSTOMRECT_H
|
#ifndef DRAWINGGUI_QGCUSTOMRECT_H
|
||||||
#define DRAWINGGUI_QGCUSTOMRECT_H
|
#define DRAWINGGUI_QGCUSTOMRECT_H
|
||||||
|
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QGraphicsRectItem>
|
#include <QGraphicsRectItem>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
explicit QGCustomRect(void);
|
explicit QGCustomRect(void);
|
||||||
~QGCustomRect() {}
|
~QGCustomRect() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 133};
|
enum {Type = QGraphicsItem::UserType + 133};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
|
|
|
@ -33,7 +33,7 @@ using namespace TechDrawGui;
|
||||||
|
|
||||||
QGCustomSvg::QGCustomSvg()
|
QGCustomSvg::QGCustomSvg()
|
||||||
{
|
{
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGCustomSvg::centerAt(QPointF centerPos)
|
void QGCustomSvg::centerAt(QPointF centerPos)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGCUSTOMSVG_H
|
#ifndef DRAWINGGUI_QGCUSTOMSVG_H
|
||||||
#define DRAWINGGUI_QGCUSTOMSVG_H
|
#define DRAWINGGUI_QGCUSTOMSVG_H
|
||||||
|
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QGraphicsSvgItem>
|
#include <QGraphicsSvgItem>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
explicit QGCustomSvg(void);
|
explicit QGCustomSvg(void);
|
||||||
~QGCustomSvg() {}
|
~QGCustomSvg() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 131};
|
enum {Type = QGraphicsItem::UserType + 131};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
|
|
|
@ -46,7 +46,7 @@ using namespace TechDrawGui;
|
||||||
|
|
||||||
QGCustomText::QGCustomText()
|
QGCustomText::QGCustomText()
|
||||||
{
|
{
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGCustomText::centerAt(QPointF centerPos)
|
void QGCustomText::centerAt(QPointF centerPos)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGCUSTOMTEXT_H
|
#ifndef DRAWINGGUI_QGCUSTOMTEXT_H
|
||||||
#define DRAWINGGUI_QGCUSTOMTEXT_H
|
#define DRAWINGGUI_QGCUSTOMTEXT_H
|
||||||
|
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
explicit QGCustomText(void);
|
explicit QGCustomText(void);
|
||||||
~QGCustomText() {}
|
~QGCustomText() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 130};
|
enum {Type = QGraphicsItem::UserType + 130};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
|
|
|
@ -46,7 +46,7 @@ QGIArrow::QGIArrow(QGraphicsScene *scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Cache Mode
|
// Set Cache Mode
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGRAPHICSITEMARROW_H
|
#ifndef DRAWINGGUI_QGRAPHICSITEMARROW_H
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMARROW_H
|
#define DRAWINGGUI_QGRAPHICSITEMARROW_H
|
||||||
|
|
||||||
# include <QGI>
|
# include <QGraphicsItem>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
@ -43,7 +43,7 @@ public:
|
||||||
explicit QGIArrow(QGraphicsScene *scene = 0 );
|
explicit QGIArrow(QGraphicsScene *scene = 0 );
|
||||||
~QGIArrow() {}
|
~QGIArrow() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 109};
|
enum {Type = QGraphicsItem::UserType + 109};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
#include <Gui/Selection.h>
|
#include <Gui/Selection.h>
|
||||||
#include <Gui/Command.h>
|
#include <Gui/Command.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/Geometry.h>
|
#include <Mod/TechDraw/App/Geometry.h>
|
||||||
#include <Mod/Drawing/App/DrawParametricTemplate.h>
|
#include <Mod/TechDraw/App/DrawParametricTemplate.h>
|
||||||
|
|
||||||
#include "QGIDrawingTemplate.h"
|
#include "QGIDrawingTemplate.h"
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ QGIDrawingTemplate::~QGIDrawingTemplate()
|
||||||
|
|
||||||
QVariant QGIDrawingTemplate::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIDrawingTemplate::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
return QGIGroup::itemChange(change, value);
|
return QGraphicsItemGroup::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
QGIDrawingTemplate(QGraphicsScene *);
|
QGIDrawingTemplate(QGraphicsScene *);
|
||||||
~QGIDrawingTemplate();
|
~QGIDrawingTemplate();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 151};
|
enum {Type = QGraphicsItem::UserType + 151};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
void clearContents();
|
void clearContents();
|
||||||
|
|
|
@ -45,10 +45,10 @@ using namespace TechDrawGui;
|
||||||
QGIEdge::QGIEdge(int index) :
|
QGIEdge::QGIEdge(int index) :
|
||||||
projIndex(index)
|
projIndex(index)
|
||||||
{
|
{
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setFlag(QGI::ItemIsSelectable, true);
|
setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
setFlag(QGI::ItemSendsScenePositionChanges, true);
|
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
setFlag(QGI::ItemSendsGeometryChanges,true);
|
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
|
|
||||||
strokeWidth = 1.;
|
strokeWidth = 1.;
|
||||||
|
@ -100,7 +100,7 @@ QVariant QGIEdge::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
setPrettyNormal();
|
setPrettyNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QGI::itemChange(change, value);
|
return QGraphicsItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIEdge::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void QGIEdge::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGRAPHICSITEMEDGE_H
|
#ifndef DRAWINGGUI_QGRAPHICSITEMEDGE_H
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMEDGE_H
|
#define DRAWINGGUI_QGRAPHICSITEMEDGE_H
|
||||||
|
|
||||||
# include <QGI>
|
# include <QGraphicsItem>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
@ -44,7 +44,7 @@ public:
|
||||||
explicit QGIEdge(int index);
|
explicit QGIEdge(int index);
|
||||||
~QGIEdge() {}
|
~QGIEdge() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 103};
|
enum {Type = QGraphicsItem::UserType + 103};
|
||||||
|
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
|
|
|
@ -50,7 +50,7 @@ QGIFace::QGIFace(int ref) :
|
||||||
m_fill(Qt::Dense3Pattern)
|
m_fill(Qt::Dense3Pattern)
|
||||||
//m_fill(Qt::Dense6Pattern)
|
//m_fill(Qt::Dense6Pattern)
|
||||||
{
|
{
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
|
|
||||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||||
|
@ -76,7 +76,7 @@ QVariant QGIFace::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
setPrettyNormal();
|
setPrettyNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QGI::itemChange(change, value);
|
return QGraphicsItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIFace::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void QGIFace::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMFACE_H
|
#define DRAWINGGUI_QGRAPHICSITEMFACE_H
|
||||||
|
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
@ -44,7 +44,7 @@ public:
|
||||||
explicit QGIFace(int ref = -1);
|
explicit QGIFace(int ref = -1);
|
||||||
~QGIFace() {}
|
~QGIFace() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 104};
|
enum {Type = QGraphicsItem::UserType + 104};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
#include <Base/Parameter.h>
|
#include <Base/Parameter.h>
|
||||||
#include <Gui/Command.h>
|
#include <Gui/Command.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/DrawHatch.h>
|
#include <Mod/TechDraw/App/DrawHatch.h>
|
||||||
#include <Mod/Drawing/App/DrawViewPart.h>
|
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||||
|
|
||||||
#include "QGIView.h"
|
#include "QGIView.h"
|
||||||
#include "QGIHatch.h"
|
#include "QGIHatch.h"
|
||||||
|
@ -60,9 +60,9 @@ QGIHatch::QGIHatch(std::string parentHatch) :
|
||||||
//m_fill(Qt::Dense6Pattern)
|
//m_fill(Qt::Dense6Pattern)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setFlag(QGI::ItemIsMovable, false);
|
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
|
||||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Drawing/Colors");
|
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Drawing/Colors");
|
||||||
|
@ -111,7 +111,7 @@ QVariant QGIHatch::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
setPrettyNormal();
|
setPrettyNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QGI::itemChange(change, value);
|
return QGraphicsItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIHatch::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void QGIHatch::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMHATCH_H
|
#define DRAWINGGUI_QGRAPHICSITEMHATCH_H
|
||||||
|
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public:
|
||||||
explicit QGIHatch(std::string parentHatch);
|
explicit QGIHatch(std::string parentHatch);
|
||||||
~QGIHatch();
|
~QGIHatch();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 122};
|
enum {Type = QGraphicsItem::UserType + 122};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
#include <Gui/Selection.h>
|
#include <Gui/Selection.h>
|
||||||
#include <Gui/Command.h>
|
#include <Gui/Command.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/DrawProjGroupItem.h>
|
#include <Mod/TechDraw/App/DrawProjGroupItem.h>
|
||||||
#include <Mod/Drawing/App/DrawProjGroup.h>
|
#include <Mod/TechDraw/App/DrawProjGroup.h>
|
||||||
|
|
||||||
#include "QGIProjGroup.h"
|
#include "QGIProjGroup.h"
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ QGIProjGroup::QGIProjGroup(const QPoint &pos, QGraphicsScene *scene)
|
||||||
:QGIViewCollection(pos, scene)
|
:QGIViewCollection(pos, scene)
|
||||||
{
|
{
|
||||||
setPos(pos);
|
setPos(pos);
|
||||||
origin = new QGIGroup();
|
origin = new QGraphicsItemGroup();
|
||||||
origin->setParentItem(this);
|
origin->setParentItem(this);
|
||||||
|
|
||||||
// In place to ensure correct drawing and bounding box calculations
|
// In place to ensure correct drawing and bounding box calculations
|
||||||
|
@ -75,7 +75,7 @@ TechDraw::DrawProjGroup * QGIProjGroup::getDrawView(void) const
|
||||||
return dynamic_cast<TechDraw::DrawProjGroup *>(obj);
|
return dynamic_cast<TechDraw::DrawProjGroup *>(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QGIProjGroup::sceneEventFilter(QGI * watched, QEvent *event)
|
bool QGIProjGroup::sceneEventFilter(QGraphicsItem* watched, QEvent *event)
|
||||||
{
|
{
|
||||||
// i want to handle events before the child item that would ordinarily receive them
|
// i want to handle events before the child item that would ordinarily receive them
|
||||||
if(event->type() == QEvent::GraphicsSceneMousePress ||
|
if(event->type() == QEvent::GraphicsSceneMousePress ||
|
||||||
|
@ -113,7 +113,7 @@ bool QGIProjGroup::sceneEventFilter(QGI * watched, QEvent *event)
|
||||||
QVariant QGIProjGroup::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIProjGroup::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
if(change == ItemChildAddedChange && scene()) {
|
if(change == ItemChildAddedChange && scene()) {
|
||||||
QGI *childItem = value.value<QGI*>();
|
QGraphicsItem*childItem = value.value<QGraphicsItem*>();
|
||||||
QGIView* gView = dynamic_cast<QGIView *>(childItem);
|
QGIView* gView = dynamic_cast<QGIView *>(childItem);
|
||||||
if(gView) {
|
if(gView) {
|
||||||
TechDraw::DrawView *fView = gView->getViewObject();
|
TechDraw::DrawView *fView = gView->getViewObject();
|
||||||
|
@ -205,9 +205,9 @@ QGIView * QGIProjGroup::getAnchorQItem() const
|
||||||
TechDraw::DrawView *anchorView = dynamic_cast<TechDraw::DrawView *>(anchorObj);
|
TechDraw::DrawView *anchorView = dynamic_cast<TechDraw::DrawView *>(anchorObj);
|
||||||
|
|
||||||
// Locate the anchor view's qgraphicsitemview
|
// Locate the anchor view's qgraphicsitemview
|
||||||
QList<QGI *> list = childItems();
|
QList<QGraphicsItem*> list = childItems();
|
||||||
|
|
||||||
for (QList<QGI *>::iterator it = list.begin(); it != list.end(); ++it) {
|
for (QList<QGraphicsItem*>::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
QGIView *view = dynamic_cast<QGIView *>(*it);
|
QGIView *view = dynamic_cast<QGIView *>(*it);
|
||||||
if(view && strcmp(view->getViewName(), anchorView->getNameInDocument()) == 0) {
|
if(view && strcmp(view->getViewName(), anchorView->getNameInDocument()) == 0) {
|
||||||
return view;
|
return view;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGIProjGroup_H
|
#ifndef DRAWINGGUI_QGIProjGroup_H
|
||||||
#define DRAWINGGUI_QGIProjGroup_H
|
#define DRAWINGGUI_QGIProjGroup_H
|
||||||
|
|
||||||
#include <QGIGroup>
|
#include <QGraphicsItemGroup>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <App/PropertyLinks.h>
|
#include <App/PropertyLinks.h>
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
QGIProjGroup(const QPoint &position, QGraphicsScene *scene);
|
QGIProjGroup(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIProjGroup();
|
~QGIProjGroup();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 113};
|
enum {Type = QGraphicsItem::UserType + 113};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
void alignTo(QGIProjGroup *, const QString &alignment);
|
void alignTo(QGIProjGroup *, const QString &alignment);
|
||||||
|
@ -62,7 +62,7 @@ Q_SIGNALS:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool sceneEventFilter(QGI * watched, QEvent *event);
|
virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent *event);
|
||||||
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||||
// Mouse handling
|
// Mouse handling
|
||||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event );
|
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event );
|
||||||
|
@ -75,7 +75,7 @@ private:
|
||||||
TechDraw::DrawProjGroup * getDrawView(void) const;
|
TechDraw::DrawProjGroup * getDrawView(void) const;
|
||||||
|
|
||||||
QGraphicsRectItem * m_backgroundItem;
|
QGraphicsRectItem * m_backgroundItem;
|
||||||
QGI *origin;
|
QGraphicsItem*origin;
|
||||||
QPoint mousePos;
|
QPoint mousePos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
#include <Base/Parameter.h>
|
#include <Base/Parameter.h>
|
||||||
#include <Gui/Command.h>
|
#include <Gui/Command.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/Geometry.h>
|
#include <Mod/TechDraw/App/Geometry.h>
|
||||||
#include <Mod/Drawing/App/DrawSVGTemplate.h>
|
#include <Mod/TechDraw/App/DrawSVGTemplate.h>
|
||||||
|
|
||||||
#include "QGISVGTemplate.h"
|
#include "QGISVGTemplate.h"
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ QGISVGTemplate::QGISVGTemplate(QGraphicsScene *scene)
|
||||||
m_svgItem = new QGraphicsSvgItem();
|
m_svgItem = new QGraphicsSvgItem();
|
||||||
m_svgItem->setSharedRenderer(m_svgRender);
|
m_svgItem->setSharedRenderer(m_svgRender);
|
||||||
|
|
||||||
m_svgItem->setFlags(QGI::ItemClipsToShape);
|
m_svgItem->setFlags(QGraphicsItem::ItemClipsToShape);
|
||||||
m_svgItem->setCacheMode(QGI::NoCache);
|
m_svgItem->setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
|
||||||
addToGroup(m_svgItem);
|
addToGroup(m_svgItem);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ QGISVGTemplate::~QGISVGTemplate()
|
||||||
QVariant QGISVGTemplate::itemChange(GraphicsItemChange change,
|
QVariant QGISVGTemplate::itemChange(GraphicsItemChange change,
|
||||||
const QVariant &value)
|
const QVariant &value)
|
||||||
{
|
{
|
||||||
return QGIGroup::itemChange(change, value);
|
return QGraphicsItemGroup::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
QGISVGTemplate(QGraphicsScene *);
|
QGISVGTemplate(QGraphicsScene *);
|
||||||
~QGISVGTemplate();
|
~QGISVGTemplate();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 153};
|
enum {Type = QGraphicsItem::UserType + 153};
|
||||||
int type() const { return Type; }
|
int type() const { return Type; }
|
||||||
|
|
||||||
/// Currently just frees up textFields
|
/// Currently just frees up textFields
|
||||||
|
|
|
@ -28,17 +28,17 @@
|
||||||
#include <Base/Console.h>
|
#include <Base/Console.h>
|
||||||
#include <Base/Exception.h>
|
#include <Base/Exception.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/DrawTemplate.h>
|
#include <Mod/TechDraw/App/DrawTemplate.h>
|
||||||
|
|
||||||
#include "QGITemplate.h"
|
#include "QGITemplate.h"
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGITemplate::QGITemplate(QGraphicsScene *scene) : QGIGroup(),
|
QGITemplate::QGITemplate(QGraphicsScene *scene) : QGraphicsItemGroup(),
|
||||||
pageTemplate(0)
|
pageTemplate(0)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setZValue(-1000); //Template is situated in background
|
setZValue(-1000); //Template is situated in background
|
||||||
|
|
||||||
scene->addItem(this);
|
scene->addItem(this);
|
||||||
|
@ -51,7 +51,7 @@ QGITemplate::~QGITemplate()
|
||||||
|
|
||||||
QVariant QGITemplate::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGITemplate::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
return QGIGroup::itemChange(change, value);
|
return QGraphicsItemGroup::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGITemplate::setTemplate(TechDraw::DrawTemplate *obj)
|
void QGITemplate::setTemplate(TechDraw::DrawTemplate *obj)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGRAPHICSITEMTEMPLATE_H
|
#ifndef DRAWINGGUI_QGRAPHICSITEMTEMPLATE_H
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMTEMPLATE_H
|
#define DRAWINGGUI_QGRAPHICSITEMTEMPLATE_H
|
||||||
|
|
||||||
#include <QGIGroup>
|
#include <QGraphicsItemGroup>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "TemplateTextField.h"
|
#include "TemplateTextField.h"
|
||||||
|
@ -39,7 +39,7 @@ class DrawTemplate;
|
||||||
namespace TechDrawGui
|
namespace TechDrawGui
|
||||||
{
|
{
|
||||||
|
|
||||||
class TechDrawGuiExport QGITemplate : public QObject, public QGIGroup
|
class TechDrawGuiExport QGITemplate : public QObject, public QGraphicsItemGroup
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public:
|
||||||
QGITemplate(QGraphicsScene *);
|
QGITemplate(QGraphicsScene *);
|
||||||
~QGITemplate();
|
~QGITemplate();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 150};
|
enum {Type = QGraphicsItem::UserType + 150};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
void clearContents();
|
void clearContents();
|
||||||
|
|
|
@ -45,10 +45,10 @@ QGIVertex::QGIVertex(int index) :
|
||||||
m_radius(2),
|
m_radius(2),
|
||||||
m_fill(Qt::SolidPattern)
|
m_fill(Qt::SolidPattern)
|
||||||
{
|
{
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setFlag(QGI::ItemIsSelectable, true);
|
setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
setFlag(QGI::ItemSendsScenePositionChanges, true);
|
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
setFlag(QGI::ItemSendsGeometryChanges,true);
|
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
|
|
||||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||||
|
@ -73,7 +73,7 @@ QVariant QGIVertex::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
setPrettyNormal();
|
setPrettyNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QGI::itemChange(change, value);
|
return QGraphicsItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIVertex::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void QGIVertex::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGRAPHICSITEMVERTEX_H
|
#ifndef DRAWINGGUI_QGRAPHICSITEMVERTEX_H
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMVERTEX_H
|
#define DRAWINGGUI_QGRAPHICSITEMVERTEX_H
|
||||||
|
|
||||||
# include <QGI>
|
# include <QGraphicsItem>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
@ -44,7 +44,7 @@ public:
|
||||||
explicit QGIVertex(int index);
|
explicit QGIVertex(int index);
|
||||||
~QGIVertex() {}
|
~QGIVertex() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 105};
|
enum {Type = QGraphicsItem::UserType + 105};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
|
|
||||||
|
@ -86,4 +86,3 @@ private:
|
||||||
} // namespace MDIViewPageGui
|
} // namespace MDIViewPageGui
|
||||||
|
|
||||||
#endif // DRAWINGGUI_QGRAPHICSITEMVERTEX_H
|
#endif // DRAWINGGUI_QGRAPHICSITEMVERTEX_H
|
||||||
|
|
||||||
|
|
|
@ -58,14 +58,14 @@ using namespace TechDrawGui;
|
||||||
void _debugRect(char* text, QRectF r);
|
void _debugRect(char* text, QRectF r);
|
||||||
|
|
||||||
QGIView::QGIView(const QPoint &pos, QGraphicsScene *scene)
|
QGIView::QGIView(const QPoint &pos, QGraphicsScene *scene)
|
||||||
:QGIGroup(),
|
:QGraphicsItemGroup(),
|
||||||
locked(false),
|
locked(false),
|
||||||
borderVisible(true),
|
borderVisible(true),
|
||||||
m_innerView(false)
|
m_innerView(false)
|
||||||
{
|
{
|
||||||
setFlag(QGI::ItemIsSelectable,true);
|
setFlag(QGraphicsItem::ItemIsSelectable,true);
|
||||||
setFlag(QGI::ItemSendsScenePositionChanges, true);
|
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
setFlag(QGI::ItemSendsGeometryChanges,true);
|
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setPos(pos);
|
setPos(pos);
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ QGIView::~QGIView()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIView::alignTo(QGI *item, const QString &alignment)
|
void QGIView::alignTo(QGraphicsItem*item, const QString &alignment)
|
||||||
{
|
{
|
||||||
alignHash.clear();
|
alignHash.clear();
|
||||||
alignHash.insert(alignment, item);
|
alignHash.insert(alignment, item);
|
||||||
|
@ -122,7 +122,7 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
|
|
||||||
// TODO find a better data structure for this
|
// TODO find a better data structure for this
|
||||||
if(alignHash.size() == 1) {
|
if(alignHash.size() == 1) {
|
||||||
QGI *item = alignHash.begin().value();
|
QGraphicsItem*item = alignHash.begin().value();
|
||||||
QString alignMode = alignHash.begin().key();
|
QString alignMode = alignHash.begin().key();
|
||||||
|
|
||||||
if(alignMode == QString::fromAscii("Vertical")) {
|
if(alignMode == QString::fromAscii("Vertical")) {
|
||||||
|
@ -155,7 +155,7 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
drawBorder();
|
drawBorder();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGIGroup::itemChange(change, value);
|
return QGraphicsItemGroup::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIView::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
void QGIView::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||||
|
@ -163,13 +163,13 @@ void QGIView::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||||
if(locked) {
|
if(locked) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
} else {
|
} else {
|
||||||
QGI::mousePressEvent(event);
|
QGraphicsItem::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIView::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
|
void QGIView::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
|
||||||
{
|
{
|
||||||
QGI::mouseMoveEvent(event);
|
QGraphicsItem::mouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||||
|
@ -185,7 +185,7 @@ void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||||
getViewObject()->Y.setValue(getYInClip(y()));
|
getViewObject()->Y.setValue(getYInClip(y()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QGI::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIView::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void QGIView::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
@ -256,7 +256,7 @@ void QGIView::updateView(bool update)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
QGI::update();
|
QGraphicsItem::update();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * QGIView::getViewName() const
|
const char * QGIView::getViewName() const
|
||||||
|
@ -354,15 +354,15 @@ void QGIView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
|
||||||
m_label->hide();
|
m_label->hide();
|
||||||
m_border->hide();
|
m_border->hide();
|
||||||
}
|
}
|
||||||
QGIGroup::paint(painter, &myOption, widget);
|
QGraphicsItemGroup::paint(painter, &myOption, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF QGIView::customChildrenBoundingRect() {
|
QRectF QGIView::customChildrenBoundingRect() {
|
||||||
QList<QGI *> children = childItems();
|
QList<QGraphicsItem*> children = childItems();
|
||||||
int dimItemType = QGI::UserType + 106;
|
int dimItemType = QGraphicsItem::UserType + 106;
|
||||||
QRectF result;
|
QRectF result;
|
||||||
for (QList<QGI *>::iterator it = children.begin(); it != children.end(); ++it) {
|
for (QList<QGraphicsItem*>::iterator it = children.begin(); it != children.end(); ++it) {
|
||||||
if ((*it)->type() >= QGI::UserType) {
|
if ((*it)->type() >= QGraphicsItem::UserType) {
|
||||||
if ((*it)->type() != dimItemType) { //Dimensions don't count towards bRect
|
if ((*it)->type() != dimItemType) { //Dimensions don't count towards bRect
|
||||||
result = result.united((*it)->boundingRect());
|
result = result.united((*it)->boundingRect());
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef DRAWINGGUI_QGRAPHICSITEMVIEW_H
|
#ifndef DRAWINGGUI_QGRAPHICSITEMVIEW_H
|
||||||
#define DRAWINGGUI_QGRAPHICSITEMVIEW_H
|
#define DRAWINGGUI_QGRAPHICSITEMVIEW_H
|
||||||
|
|
||||||
#include <QGIGroup>
|
#include <QGraphicsItemGroup>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <App/PropertyLinks.h>
|
#include <App/PropertyLinks.h>
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class DrawView;
|
||||||
namespace TechDrawGui
|
namespace TechDrawGui
|
||||||
{
|
{
|
||||||
|
|
||||||
class TechDrawGuiExport QGIView : public QObject, public QGIGroup
|
class TechDrawGuiExport QGIView : public QObject, public QGraphicsItemGroup
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public:
|
||||||
QGIView(const QPoint &position, QGraphicsScene *scene);
|
QGIView(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIView();
|
~QGIView();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 101};
|
enum {Type = QGraphicsItem::UserType + 101};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
const char * getViewName() const;
|
const char * getViewName() const;
|
||||||
|
@ -64,7 +64,7 @@ public:
|
||||||
void isInnerView(bool state) { m_innerView = state; }
|
void isInnerView(bool state) { m_innerView = state; }
|
||||||
double getYInClip(double y);
|
double getYInClip(double y);
|
||||||
|
|
||||||
void alignTo(QGI *, const QString &alignment);
|
void alignTo(QGraphicsItem*, const QString &alignment);
|
||||||
void setLocked(bool state = true) { locked = true; }
|
void setLocked(bool state = true) { locked = true; }
|
||||||
|
|
||||||
virtual void toggleCache(bool state);
|
virtual void toggleCache(bool state);
|
||||||
|
@ -90,7 +90,7 @@ protected:
|
||||||
TechDraw::DrawView *viewObj;
|
TechDraw::DrawView *viewObj;
|
||||||
std::string viewName;
|
std::string viewName;
|
||||||
|
|
||||||
QHash<QString, QGI *> alignHash;
|
QHash<QString, QGraphicsItem*> alignHash;
|
||||||
bool locked;
|
bool locked;
|
||||||
bool borderVisible;
|
bool borderVisible;
|
||||||
bool m_innerView; //View is inside another View
|
bool m_innerView; //View is inside another View
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QGraphicsSceneHoverEvent>
|
#include <QGraphicsSceneHoverEvent>
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
#include <QPainterPathStroker>
|
#include <QPainterPathStroker>
|
||||||
|
@ -54,9 +54,9 @@ QGIViewAnnotation::QGIViewAnnotation(const QPoint &pos, QGraphicsScene *scene)
|
||||||
:QGIView(pos, scene)
|
:QGIView(pos, scene)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setFlag(QGI::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
|
||||||
m_textItem = new QGCustomText();
|
m_textItem = new QGCustomText();
|
||||||
addToGroup(m_textItem);
|
addToGroup(m_textItem);
|
||||||
|
@ -146,4 +146,3 @@ QRectF QGIViewAnnotation::boundingRect() const
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_QGIViewAnnotation.cpp"
|
#include "moc_QGIViewAnnotation.cpp"
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
explicit QGIViewAnnotation(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewAnnotation(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIViewAnnotation();
|
~QGIViewAnnotation();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 120};
|
enum {Type = QGraphicsItem::UserType + 120};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
void updateView(bool update = false);
|
void updateView(bool update = false);
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QGraphicsSceneHoverEvent>
|
#include <QGraphicsSceneHoverEvent>
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
#include <QPainterPathStroker>
|
#include <QPainterPathStroker>
|
||||||
|
@ -54,10 +54,10 @@ QGIViewClip::QGIViewClip(const QPoint &pos, QGraphicsScene *scene)
|
||||||
:QGIView(pos, scene)
|
:QGIView(pos, scene)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setFlag(QGI::ItemIsSelectable, true);
|
setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
setFlag(QGI::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
|
||||||
m_cliparea = new QGCustomClip();
|
m_cliparea = new QGCustomClip();
|
||||||
addToGroup(m_cliparea);
|
addToGroup(m_cliparea);
|
||||||
|
@ -151,8 +151,8 @@ void QGIViewClip::drawClip()
|
||||||
}
|
}
|
||||||
|
|
||||||
//for all graphic views in qgigroup, remove from qgigroup the ones that aren't in ViewClip
|
//for all graphic views in qgigroup, remove from qgigroup the ones that aren't in ViewClip
|
||||||
QList<QGI *> qgItems = m_cliparea->childItems();
|
QList<QGraphicsItem*> qgItems = m_cliparea->childItems();
|
||||||
QList<QGI *>::iterator it = qgItems.begin();
|
QList<QGraphicsItem*>::iterator it = qgItems.begin();
|
||||||
for (; it != qgItems.end(); it++) {
|
for (; it != qgItems.end(); it++) {
|
||||||
QGIView* qv = dynamic_cast<QGIView*>((*it));
|
QGIView* qv = dynamic_cast<QGIView*>((*it));
|
||||||
if (qv) {
|
if (qv) {
|
||||||
|
@ -169,8 +169,8 @@ void QGIViewClip::drawClip()
|
||||||
|
|
||||||
QGIView* QGIViewClip::getQGIVByName(std::string name) //should probably be method in MDIViewPage?? but qgiv can't get drawingView? or QGVPage!
|
QGIView* QGIViewClip::getQGIVByName(std::string name) //should probably be method in MDIViewPage?? but qgiv can't get drawingView? or QGVPage!
|
||||||
{
|
{
|
||||||
QList<QGI *> qgItems = scene()->items();
|
QList<QGraphicsItem*> qgItems = scene()->items();
|
||||||
QList<QGI *>::iterator it = qgItems.begin();
|
QList<QGraphicsItem*>::iterator it = qgItems.begin();
|
||||||
for (; it != qgItems.end(); it++) {
|
for (; it != qgItems.end(); it++) {
|
||||||
QGIView* qv = dynamic_cast<QGIView*>((*it));
|
QGIView* qv = dynamic_cast<QGIView*>((*it));
|
||||||
if (qv) {
|
if (qv) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
explicit QGIViewClip(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewClip(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIViewClip();
|
~QGIViewClip();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 123};
|
enum {Type = QGraphicsItem::UserType + 123};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
virtual void updateView(bool update = false);
|
virtual void updateView(bool update = false);
|
||||||
|
|
|
@ -45,14 +45,14 @@ using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewCollection::QGIViewCollection(const QPoint &pos, QGraphicsScene *scene) :QGIView(pos, scene)
|
QGIViewCollection::QGIViewCollection(const QPoint &pos, QGraphicsScene *scene) :QGIView(pos, scene)
|
||||||
{
|
{
|
||||||
setFlags(QGI::ItemIsSelectable);
|
setFlags(QGraphicsItem::ItemIsSelectable);
|
||||||
setPos(pos);
|
setPos(pos);
|
||||||
|
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
|
|
||||||
//setCacheMode(QGI::NoCache);
|
//setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setFlag(QGI::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewCollection::~QGIViewCollection()
|
QGIViewCollection::~QGIViewCollection()
|
||||||
|
@ -63,7 +63,7 @@ QGIViewCollection::~QGIViewCollection()
|
||||||
QVariant QGIViewCollection::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIViewCollection::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
|
|
||||||
return QGIGroup::itemChange(change, value);
|
return QGraphicsItemGroup::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIViewCollection::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
void QGIViewCollection::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||||
|
@ -77,7 +77,7 @@ void QGIViewCollection::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
|
||||||
Gui::Command::commitCommand();
|
Gui::Command::commitCommand();
|
||||||
//Gui::Command::updateActive();
|
//Gui::Command::updateActive();
|
||||||
}
|
}
|
||||||
QGI::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIViewCollection::updateView(bool update)
|
void QGIViewCollection::updateView(bool update)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef _DRAWINGGUI_QGRAPHICSITEMVIEWCOLLECTION_H
|
#ifndef _DRAWINGGUI_QGRAPHICSITEMVIEWCOLLECTION_H
|
||||||
#define _DRAWINGGUI_QGRAPHICSITEMVIEWCOLLECTION_H
|
#define _DRAWINGGUI_QGRAPHICSITEMVIEWCOLLECTION_H
|
||||||
|
|
||||||
#include <QGIGroup>
|
#include <QGraphicsItemGroup>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <App/PropertyLinks.h>
|
#include <App/PropertyLinks.h>
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
QGIViewCollection(const QPoint &position, QGraphicsScene *scene);
|
QGIViewCollection(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIViewCollection();
|
~QGIViewCollection();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 110};
|
enum {Type = QGraphicsItem::UserType + 110};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
virtual void updateView(bool update = false);
|
virtual void updateView(bool update = false);
|
||||||
|
|
|
@ -59,9 +59,9 @@
|
||||||
|
|
||||||
#include <Mod/Part/App/PartFeature.h>
|
#include <Mod/Part/App/PartFeature.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/DrawViewDimension.h>
|
#include <Mod/TechDraw/App/DrawViewDimension.h>
|
||||||
#include <Mod/Drawing/App/DrawViewPart.h>
|
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||||
#include <Mod/Drawing/App/DrawUtil.h>
|
#include <Mod/TechDraw/App/DrawUtil.h>
|
||||||
|
|
||||||
#include "QGIViewDimension.h"
|
#include "QGIViewDimension.h"
|
||||||
#include "QGIArrow.h"
|
#include "QGIArrow.h"
|
||||||
|
@ -82,7 +82,7 @@ QGIDatumLabel::QGIDatumLabel(int ref, QGraphicsScene *scene ) : reference(ref)
|
||||||
posX = 0;
|
posX = 0;
|
||||||
posY = 0;
|
posY = 0;
|
||||||
|
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setFlag(ItemSendsGeometryChanges, true);
|
setFlag(ItemSendsGeometryChanges, true);
|
||||||
setFlag(ItemIsMovable, true);
|
setFlag(ItemIsMovable, true);
|
||||||
setFlag(ItemIsSelectable, true);
|
setFlag(ItemIsSelectable, true);
|
||||||
|
@ -114,7 +114,7 @@ QVariant QGIDatumLabel::itemChange(GraphicsItemChange change, const QVariant &va
|
||||||
Q_EMIT dragging();
|
Q_EMIT dragging();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGI::itemChange(change, value);
|
return QGraphicsItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIDatumLabel::setPosFromCenter(const double &xCenter, const double &yCenter)
|
void QGIDatumLabel::setPosFromCenter(const double &xCenter, const double &yCenter)
|
||||||
|
@ -154,7 +154,7 @@ void QGIDatumLabel::mouseReleaseEvent( QGraphicsSceneMouseEvent * event)
|
||||||
if(scene() && this == scene()->mouseGrabberItem()) {
|
if(scene() && this == scene()->mouseGrabberItem()) {
|
||||||
Q_EMIT dragFinished();
|
Q_EMIT dragFinished();
|
||||||
}
|
}
|
||||||
QGI::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewDimension::QGIViewDimension(const QPoint &pos, QGraphicsScene *scene) :
|
QGIViewDimension::QGIViewDimension(const QPoint &pos, QGraphicsScene *scene) :
|
||||||
|
@ -162,8 +162,8 @@ QGIViewDimension::QGIViewDimension(const QPoint &pos, QGraphicsScene *scene) :
|
||||||
hasHover(false)
|
hasHover(false)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setFlag(QGI::ItemIsMovable, false);
|
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
|
||||||
QGIDatumLabel *dlabel = new QGIDatumLabel();
|
QGIDatumLabel *dlabel = new QGIDatumLabel();
|
||||||
QGraphicsPathItem *arrws = new QGraphicsPathItem();
|
QGraphicsPathItem *arrws = new QGraphicsPathItem();
|
||||||
|
@ -548,7 +548,7 @@ void QGIViewDimension::draw()
|
||||||
|
|
||||||
if(arw.size() != 2) {
|
if(arw.size() != 2) {
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
for(std::vector<QGI *>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
for(std::vector<QGraphicsItem*>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
||||||
removeFromGroup(*it);
|
removeFromGroup(*it);
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
@ -803,7 +803,7 @@ void QGIViewDimension::draw()
|
||||||
// Create Two Arrows always (but sometimes hide one!)
|
// Create Two Arrows always (but sometimes hide one!)
|
||||||
if(arw.size() != 2) {
|
if(arw.size() != 2) {
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
for(std::vector<QGI *>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
for(std::vector<QGraphicsItem*>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
||||||
removeFromGroup(*it);
|
removeFromGroup(*it);
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
@ -936,7 +936,7 @@ void QGIViewDimension::draw()
|
||||||
QGIArrow *ar2;
|
QGIArrow *ar2;
|
||||||
if(arw.size() != 2) {
|
if(arw.size() != 2) {
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
for(std::vector<QGI *>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
for(std::vector<QGraphicsItem*>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
||||||
removeFromGroup(*it);
|
removeFromGroup(*it);
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
@ -1154,7 +1154,7 @@ void QGIViewDimension::draw()
|
||||||
// Add the arrows
|
// Add the arrows
|
||||||
if(arw.size() != 2) {
|
if(arw.size() != 2) {
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
for(std::vector<QGI *>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
for(std::vector<QGraphicsItem*>::iterator it = arw.begin(); it != arw.end(); ++it) {
|
||||||
removeFromGroup(*it);
|
removeFromGroup(*it);
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
explicit QGIDatumLabel(int ref = -1, QGraphicsScene *scene = 0 );
|
explicit QGIDatumLabel(int ref = -1, QGraphicsScene *scene = 0 );
|
||||||
~QGIDatumLabel() {}
|
~QGIDatumLabel() {}
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 107};
|
enum {Type = QGraphicsItem::UserType + 107};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
void setLabelCenter();
|
void setLabelCenter();
|
||||||
|
@ -87,7 +87,7 @@ class TechDrawGuiExport QGIViewDimension : public QGIView
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum {Type = QGI::UserType + 106};
|
enum {Type = QGraphicsItem::UserType + 106};
|
||||||
|
|
||||||
explicit QGIViewDimension(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewDimension(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIViewDimension();
|
~QGIViewDimension();
|
||||||
|
@ -116,11 +116,11 @@ protected:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool hasHover;
|
bool hasHover;
|
||||||
QGI *datumLabel; //dimension text
|
QGraphicsItem*datumLabel; //dimension text
|
||||||
QGI *arrows; //dimension lines + extension lines
|
QGraphicsItem*arrows; //dimension lines + extension lines
|
||||||
QGI *centreLines;
|
QGraphicsItem*centreLines;
|
||||||
|
|
||||||
std::vector<QGI *> arw; //arrowheads
|
std::vector<QGraphicsItem*> arw; //arrowheads
|
||||||
std::vector<TechDrawGeometry::BaseGeom *> projGeom;
|
std::vector<TechDrawGeometry::BaseGeom *> projGeom;
|
||||||
QPen pen;
|
QPen pen;
|
||||||
QColor m_colNormal;
|
QColor m_colNormal;
|
||||||
|
|
|
@ -61,9 +61,9 @@ QGIViewPart::QGIViewPart(const QPoint &pos, QGraphicsScene *scene)
|
||||||
:QGIView(pos, scene)
|
:QGIView(pos, scene)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setFlag(QGI::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
|
||||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Drawing/Colors");
|
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Drawing/Colors");
|
||||||
|
@ -79,8 +79,8 @@ QGIViewPart::~QGIViewPart()
|
||||||
QVariant QGIViewPart::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIViewPart::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
if (change == ItemSelectedHasChanged && scene()) {
|
if (change == ItemSelectedHasChanged && scene()) {
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); ++it) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); ++it) {
|
||||||
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
||||||
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
||||||
if(edge) {
|
if(edge) {
|
||||||
|
@ -98,7 +98,7 @@ QVariant QGIViewPart::itemChange(GraphicsItemChange change, const QVariant &valu
|
||||||
void QGIViewPart::tidy()
|
void QGIViewPart::tidy()
|
||||||
{
|
{
|
||||||
//Delete any leftover items
|
//Delete any leftover items
|
||||||
for(QList<QGI *>::iterator it = deleteItems.begin(); it != deleteItems.end(); ++it) {
|
for(QList<QGraphicsItem*>::iterator it = deleteItems.begin(); it != deleteItems.end(); ++it) {
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
deleteItems.clear();
|
deleteItems.clear();
|
||||||
|
@ -237,8 +237,8 @@ void QGIViewPart::updateView(bool update)
|
||||||
viewPart->ShowHiddenLines.isTouched()) {
|
viewPart->ShowHiddenLines.isTouched()) {
|
||||||
// Remove all existing graphical representations (QGIxxxx) otherwise BRect only grows, never shrinks?
|
// Remove all existing graphical representations (QGIxxxx) otherwise BRect only grows, never shrinks?
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); ++it) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); ++it) {
|
||||||
if (dynamic_cast<QGIEdge *> (*it) ||
|
if (dynamic_cast<QGIEdge *> (*it) ||
|
||||||
dynamic_cast<QGIFace *>(*it) ||
|
dynamic_cast<QGIFace *>(*it) ||
|
||||||
dynamic_cast<QGIVertex *>(*it) ||
|
dynamic_cast<QGIVertex *>(*it) ||
|
||||||
|
@ -253,8 +253,8 @@ void QGIViewPart::updateView(bool update)
|
||||||
draw();
|
draw();
|
||||||
} else if(viewPart->LineWidth.isTouched() ||
|
} else if(viewPart->LineWidth.isTouched() ||
|
||||||
viewPart->HiddenWidth.isTouched()) {
|
viewPart->HiddenWidth.isTouched()) {
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); ++it) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); ++it) {
|
||||||
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
||||||
if(edge && edge->getHiddenEdge()) {
|
if(edge && edge->getHiddenEdge()) {
|
||||||
edge->setStrokeWidth(viewPart->HiddenWidth.getValue() * lineScaleFactor);
|
edge->setStrokeWidth(viewPart->HiddenWidth.getValue() * lineScaleFactor);
|
||||||
|
@ -328,7 +328,7 @@ void QGIViewPart::drawViewPart()
|
||||||
//simplePath.setFillRule(Qt::WindingFill);
|
//simplePath.setFillRule(Qt::WindingFill);
|
||||||
//fitem->setPath(simplePath);
|
//fitem->setPath(simplePath);
|
||||||
fitem->setPath(facePath);
|
fitem->setPath(facePath);
|
||||||
fitem->setFlag(QGI::ItemIsSelectable, true);
|
fitem->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
}
|
}
|
||||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ void QGIViewPart::drawViewPart()
|
||||||
hatch->setFill(feat->HatchPattern.getValue());
|
hatch->setFill(feat->HatchPattern.getValue());
|
||||||
hatch->setColor(feat->HatchColor.getValue());
|
hatch->setColor(feat->HatchColor.getValue());
|
||||||
//_dumpPath("hatchPath",hatchPath);
|
//_dumpPath("hatchPath",hatchPath);
|
||||||
hatch->setFlag(QGI::ItemIsSelectable, true);
|
hatch->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ void QGIViewPart::drawViewPart()
|
||||||
item->setSmoothEdge(true);
|
item->setSmoothEdge(true);
|
||||||
}
|
}
|
||||||
item->setPath(drawPainterPath(*it));
|
item->setPath(drawPainterPath(*it));
|
||||||
item->setFlag(QGI::ItemIsSelectable, true);
|
item->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
item->setAcceptHoverEvents(true);
|
item->setAcceptHoverEvents(true);
|
||||||
|
|
||||||
//debug a path
|
//debug a path
|
||||||
|
@ -568,8 +568,8 @@ void QGIViewPart::pathArcSegment(QPainterPath &path,
|
||||||
|
|
||||||
QGIEdge * QGIViewPart::findRefEdge(int idx)
|
QGIEdge * QGIViewPart::findRefEdge(int idx)
|
||||||
{
|
{
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); it++) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||||
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
||||||
if(edge && edge->getReference() == idx)
|
if(edge && edge->getReference() == idx)
|
||||||
return edge;
|
return edge;
|
||||||
|
@ -579,8 +579,8 @@ QGIEdge * QGIViewPart::findRefEdge(int idx)
|
||||||
|
|
||||||
QGIVertex * QGIViewPart::findRefVertex(int idx)
|
QGIVertex * QGIViewPart::findRefVertex(int idx)
|
||||||
{
|
{
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); it++) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||||
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
||||||
if(vert && vert->getReference() == idx)
|
if(vert && vert->getReference() == idx)
|
||||||
return vert;
|
return vert;
|
||||||
|
@ -590,8 +590,8 @@ QGIVertex * QGIViewPart::findRefVertex(int idx)
|
||||||
|
|
||||||
void QGIViewPart::toggleCache(bool state)
|
void QGIViewPart::toggleCache(bool state)
|
||||||
{
|
{
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); it++) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||||
//(*it)->setCacheMode((state)? DeviceCoordinateCache : NoCache); //TODO: fiddle cache settings if req'd for performance
|
//(*it)->setCacheMode((state)? DeviceCoordinateCache : NoCache); //TODO: fiddle cache settings if req'd for performance
|
||||||
(*it)->setCacheMode((state)? NoCache : NoCache);
|
(*it)->setCacheMode((state)? NoCache : NoCache);
|
||||||
(*it)->update();
|
(*it)->update();
|
||||||
|
@ -600,8 +600,8 @@ void QGIViewPart::toggleCache(bool state)
|
||||||
|
|
||||||
void QGIViewPart::toggleCosmeticLines(bool state)
|
void QGIViewPart::toggleCosmeticLines(bool state)
|
||||||
{
|
{
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); it++) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||||
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
|
||||||
if(edge) {
|
if(edge) {
|
||||||
edge->setCosmetic(state);
|
edge->setCosmetic(state);
|
||||||
|
@ -611,8 +611,8 @@ void QGIViewPart::toggleCosmeticLines(bool state)
|
||||||
|
|
||||||
void QGIViewPart::toggleVertices(bool state)
|
void QGIViewPart::toggleVertices(bool state)
|
||||||
{
|
{
|
||||||
QList<QGI *> items = childItems();
|
QList<QGraphicsItem*> items = childItems();
|
||||||
for(QList<QGI *>::iterator it = items.begin(); it != items.end(); it++) {
|
for(QList<QGraphicsItem*>::iterator it = items.begin(); it != items.end(); it++) {
|
||||||
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
QGIVertex *vert = dynamic_cast<QGIVertex *>(*it);
|
||||||
if(vert) {
|
if(vert) {
|
||||||
if(state)
|
if(state)
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
explicit QGIViewPart(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewPart(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIViewPart();
|
~QGIViewPart();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 102};
|
enum {Type = QGraphicsItem::UserType + 102};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ protected:
|
||||||
QColor m_colHid;
|
QColor m_colHid;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QGI *> deleteItems;
|
QList<QGraphicsItem*> deleteItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MDIViewPageGui
|
} // namespace MDIViewPageGui
|
||||||
|
|
|
@ -84,7 +84,7 @@ void QGIViewSection::drawSectionFace()
|
||||||
// Draw Faces
|
// Draw Faces
|
||||||
std::vector<TechDrawGeometry::Face *>::const_iterator fit = faceGeoms.begin();
|
std::vector<TechDrawGeometry::Face *>::const_iterator fit = faceGeoms.begin();
|
||||||
|
|
||||||
QGI *graphicsItem = 0;
|
QGraphicsItem*graphicsItem = 0;
|
||||||
QPen facePen;
|
QPen facePen;
|
||||||
|
|
||||||
//TODO: check if this is the same logic as QGIVPart
|
//TODO: check if this is the same logic as QGIVPart
|
||||||
|
@ -120,7 +120,7 @@ void QGIViewSection::drawSectionFace()
|
||||||
facePen.setColor(Qt::black);
|
facePen.setColor(Qt::black);
|
||||||
item->setPen(facePen);
|
item->setPen(facePen);
|
||||||
item->moveBy(x(), y());
|
item->moveBy(x(), y());
|
||||||
graphicsItem = dynamic_cast<QGI *>(item);
|
graphicsItem = dynamic_cast<QGraphicsItem*>(item);
|
||||||
|
|
||||||
if(graphicsItem) {
|
if(graphicsItem) {
|
||||||
// Hide any edges that are hidden if option is set.
|
// Hide any edges that are hidden if option is set.
|
||||||
|
@ -128,7 +128,7 @@ void QGIViewSection::drawSectionFace()
|
||||||
// graphicsItem->hide();
|
// graphicsItem->hide();
|
||||||
|
|
||||||
addToGroup(graphicsItem);
|
addToGroup(graphicsItem);
|
||||||
graphicsItem->setFlag(QGI::ItemIsSelectable, true);
|
graphicsItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
|
|
||||||
virtual void draw();
|
virtual void draw();
|
||||||
void updateView(bool update = false);
|
void updateView(bool update = false);
|
||||||
enum {Type = QGI::UserType + 108};
|
enum {Type = QGraphicsItem::UserType + 108};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "PreCompiled.h"
|
#include "PreCompiled.h"
|
||||||
#ifndef _PreComp_
|
#ifndef _PreComp_
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QGI>
|
#include <QGraphicsItem>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsSceneHoverEvent>
|
#include <QGraphicsSceneHoverEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
@ -48,9 +48,9 @@ using namespace TechDrawGui;
|
||||||
QGIViewSymbol::QGIViewSymbol(const QPoint &pos, QGraphicsScene *scene) :QGIView(pos, scene)
|
QGIViewSymbol::QGIViewSymbol(const QPoint &pos, QGraphicsScene *scene) :QGIView(pos, scene)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGI::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setFlag(QGI::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
|
||||||
m_svgRender = new QSvgRenderer();
|
m_svgRender = new QSvgRenderer();
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
explicit QGIViewSymbol(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewSymbol(const QPoint &position, QGraphicsScene *scene);
|
||||||
~QGIViewSymbol();
|
~QGIViewSymbol();
|
||||||
|
|
||||||
enum {Type = QGI::UserType + 121};
|
enum {Type = QGraphicsItem::UserType + 121};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
||||||
void updateView(bool update = false);
|
void updateView(bool update = false);
|
||||||
|
|
|
@ -46,18 +46,18 @@
|
||||||
#include <Gui/FileDialog.h>
|
#include <Gui/FileDialog.h>
|
||||||
#include <Gui/WaitCursor.h>
|
#include <Gui/WaitCursor.h>
|
||||||
|
|
||||||
#include <Mod/Drawing/App/Geometry.h>
|
#include <Mod/TechDraw/App/Geometry.h>
|
||||||
#include <Mod/Drawing/App/DrawPage.h>
|
#include <Mod/TechDraw/App/DrawPage.h>
|
||||||
#include <Mod/Drawing/App/DrawTemplate.h>
|
#include <Mod/TechDraw/App/DrawTemplate.h>
|
||||||
#include <Mod/Drawing/App/DrawSVGTemplate.h>
|
#include <Mod/TechDraw/App/DrawSVGTemplate.h>
|
||||||
#include <Mod/Drawing/App/DrawParametricTemplate.h>
|
#include <Mod/TechDraw/App/DrawParametricTemplate.h>
|
||||||
#include <Mod/Drawing/App/DrawViewCollection.h>
|
#include <Mod/TechDraw/App/DrawViewCollection.h>
|
||||||
#include <Mod/Drawing/App/DrawViewDimension.h>
|
#include <Mod/TechDraw/App/DrawViewDimension.h>
|
||||||
#include <Mod/Drawing/App/DrawProjGroup.h>
|
#include <Mod/TechDraw/App/DrawProjGroup.h>
|
||||||
#include <Mod/Drawing/App/DrawViewPart.h>
|
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||||
#include <Mod/Drawing/App/DrawViewAnnotation.h>
|
#include <Mod/TechDraw/App/DrawViewAnnotation.h>
|
||||||
#include <Mod/Drawing/App/DrawViewSymbol.h>
|
#include <Mod/TechDraw/App/DrawViewSymbol.h>
|
||||||
#include <Mod/Drawing/App/DrawViewClip.h>
|
#include <Mod/TechDraw/App/DrawViewClip.h>
|
||||||
|
|
||||||
#include "ViewProviderPage.h"
|
#include "ViewProviderPage.h"
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ QGVPage::QGVPage(ViewProviderDrawingPage *vp, QWidget *parent)
|
||||||
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
|
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
m_backgroundItem = new QGraphicsRectItem();
|
m_backgroundItem = new QGraphicsRectItem();
|
||||||
m_backgroundItem->setCacheMode(QGI::NoCache);
|
m_backgroundItem->setCacheMode(QGraphicsItem::NoCache);
|
||||||
m_backgroundItem->setZValue(-999999);
|
m_backgroundItem->setZValue(-999999);
|
||||||
// scene()->addItem(m_backgroundItem); // TODO IF SEGFAULTS WITH DRAW ENABLE THIS (REDRAWS ARE SLOWER :s)
|
// scene()->addItem(m_backgroundItem); // TODO IF SEGFAULTS WITH DRAW ENABLE THIS (REDRAWS ARE SLOWER :s)
|
||||||
|
|
||||||
|
@ -451,9 +451,9 @@ void QGVPage::setViewOutline(bool enable)
|
||||||
void QGVPage::toggleEdit(bool enable)
|
void QGVPage::toggleEdit(bool enable)
|
||||||
{
|
{
|
||||||
// TODO: needs fiddling to handle items that don't inherit QGIViewPart: Annotation, Symbol, Templates, Edges, Faces, Vertices,...
|
// TODO: needs fiddling to handle items that don't inherit QGIViewPart: Annotation, Symbol, Templates, Edges, Faces, Vertices,...
|
||||||
QList<QGI *> list = scene()->items();
|
QList<QGraphicsItem*> list = scene()->items();
|
||||||
|
|
||||||
for (QList<QGI *>::iterator it = list.begin(); it != list.end(); ++it) {
|
for (QList<QGraphicsItem*>::iterator it = list.begin(); it != list.end(); ++it) {
|
||||||
QGIView *itemView = dynamic_cast<QGIView *>(*it);
|
QGIView *itemView = dynamic_cast<QGIView *>(*it);
|
||||||
if(itemView) {
|
if(itemView) {
|
||||||
QGIViewPart *viewPart = dynamic_cast<QGIViewPart *>(*it);
|
QGIViewPart *viewPart = dynamic_cast<QGIViewPart *>(*it);
|
||||||
|
@ -470,10 +470,10 @@ void QGVPage::toggleEdit(bool enable)
|
||||||
//itemView->updateView(true);
|
//itemView->updateView(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGI *item = dynamic_cast<QGI *>(*it);
|
QGraphicsItem*item = dynamic_cast<QGraphicsItem*>(*it);
|
||||||
if(item) {
|
if(item) {
|
||||||
//item->setCacheMode((enable) ? QGI::DeviceCoordinateCache : QGI::NoCache);
|
//item->setCacheMode((enable) ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
|
||||||
item->setCacheMode((enable) ? QGI::NoCache : QGI::NoCache);
|
item->setCacheMode((enable) ? QGraphicsItem::NoCache : QGraphicsItem::NoCache);
|
||||||
item->update();
|
item->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user