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