44 LinkModeAutoStartEndFollowMouseClick
50 DAGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* p =
nullptr);
53 QPointF getCurrentMouseScenePos()
const;
55 QPointF getLastMousePressScenePos()
const;
57 QList< QGraphicsItem* > getSelectedMovableItems();
59 QUndoCommand* addItem_(QGraphicsItem* item);
60 QUndoCommand* addItems_(
const QList< QGraphicsItem* >& its);
62 QUndoCommand* removeItem_(QGraphicsItem* item);
63 QUndoCommand* removeItems_(
const QList< QGraphicsItem* >& its);
65 QPixmap toPixamp(
int dpi = 0);
67 QImage toImage(
int dpi = 0);
69 void beginLink(
DAGraphicsLinkItem* linkItem, LinkMode lm = LinkModeAutoStartEndFollowMouseClick);
71 bool isStartLink()
const;
75 virtual void cancelLink();
77 virtual void cancel();
82 void setIgnoreLinkEvent(
bool on);
83 bool isIgnoreLinkEvent()
const;
85 void groupingSelectItems_();
87 void removeSelectItemGroup_();
89 bool isEnableSnapToGrid()
const;
91 bool isShowGridLine();
93 void setGridSize(
const QSize& gs);
94 QSize getGridSize()
const;
96 void setGridLinePen(
const QPen& p);
97 QPen getGridLinePen()
const;
99 void setPaintBackgroundInCache(
bool on);
100 bool isPaintBackgroundInCache()
const;
103 QUndoStack& undoStack();
104 const QUndoStack& undoStack()
const;
105 QUndoStack* getUndoStack()
const;
106 void setUndoStackActive();
107 void push(QUndoCommand* cmd);
110 QGraphicsItem* findItemByID(uint64_t
id,
bool recursion =
false)
const;
111 static QGraphicsItem* findItemByID(
const QList< QGraphicsItem* >& its, uint64_t
id,
bool recursion =
false);
114 QList< QGraphicsItem* > topItems()
const;
115 QList< QGraphicsItem* > topItems(
const QPointF& scenePos)
const;
117 QList< DAGraphicsItem* > selectedDAItems()
const;
119 void setReady(
bool on);
120 bool isReady()
const;
123 bool isHaveSceneAction()
const;
126 QList< DAGraphicsLayout* > getLayouts()
const;
128 bool isReadOnly()
const;
138 virtual bool isItemCanMove(QGraphicsItem* positem,
const QPointF& scenePos);
142 static int getDefaultDPI();
144 static int dpiToPx(
int dpi,
int r);
146 static void addItemToGroup(QGraphicsItemGroup* group,
const QList< QGraphicsItem* >& willGroupItems);
149 void setEnableSnapToGrid(
bool on =
true);
151 void showGridLine(
bool on);
157 void clearSelection();
159 int setSelectionState(
const QList< QGraphicsItem* >& its,
bool isSelect);
161 void setReadOnly(
bool on);
165 void clearSceneAction();
178 const QList< QPointF >& oldPos,
179 const QList< QPointF >& newPos);
250 void emitItemsPositionChanged(
const QList< QGraphicsItem* >& items,
251 const QList< QPointF >& oldPos,
252 const QList< QPointF >& newPos);
258 void addItemWithSignal(QGraphicsItem* item);
262 void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent)
override;
264 void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent)
override;
266 void mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent)
override;
268 void drawBackground(QPainter* painter,
const QRectF& rect)
override;
271 void onSelectionChanged();
275 void checkSelectItem(QGraphicsItem* item);
276 int changeAllSelection(
bool setSelect);
支持缩放编辑的文本框Item
Definition DAGraphicsTextItem.h:14