52 #include <QApplication>
53 #include <QColorDialog>
55 #include <QInputDialog>
60 #include <QMessageBox>
63 #include <QStyleOptionGraphicsItem>
64 #include <QWheelEvent>
65 #include <QWidgetAction>
73 const QString GraphGraphicsView::sAssignToGrouping(
"Assign to grouping ");
77 mMinimapEnabled(false), mGridEnabled(true), mGridClustersEnabled(true),
80 mDragModifier(
Qt::KeyboardModifier::AltModifier),
81 mPanModifier(
Qt::KeyboardModifier::ShiftModifier),
82 mZoomModifier(
Qt::NoModifier),
83 mZoomFactorBase(1.0015)
96 void GraphGraphicsView::conditionalUpdate()
127 void GraphGraphicsView::handleIsolationViewAction()
135 if (selected_modules.size() == 1 && selected_gates.empty())
137 u32 module_id = *selected_modules.
begin();
146 UserActionCompound* act =
new UserActionCompound;
147 act->setUseCreatedObject();
150 act->addAction(
new ActionAddItemsToObject(selected_modules, selected_gates));
154 context->setExclusiveModuleId(module_id);
160 UserActionCompound* act =
new UserActionCompound;
161 act->setUseCreatedObject();
163 act->addAction(
new ActionAddItemsToObject(selected_modules, selected_gates));
169 void GraphGraphicsView::adjustMinScale()
176 void GraphGraphicsView::handleAddCommentAction()
181 auto node =
action->data().value<Node>();
182 CommentDialog commentDialog(
"New Comment");
185 commentDialog.close();
236 #ifdef GUI_DEBUG_GRID
238 debugDrawLayouterGridpos(painter);
241 if (!mMinimapEnabled)
249 #ifdef GUI_DEBUG_GRID
250 void GraphGraphicsView::debugDrawLayouterGridpos(
QPainter* painter)
269 mMovePosition =
event->pos();
274 if (item && itemDraggable(item))
276 mDragController->
set(item,
event->pos());
280 mDragController->
clear();
284 mousePressEventNotItemDrag(
event);
287 mousePressEventNotItemDrag(
event);
290 void GraphGraphicsView::mousePressEventNotItemDrag(
QMouseEvent *event)
310 QPointF delta = mTargetViewportPos -
event->pos();
312 if (qAbs(delta.
x()) > 5 || qAbs(delta.
y()) > 5)
314 mTargetViewportPos =
event->pos();
323 QPoint delta_move =
event->pos() - mMovePosition;
324 mMovePosition =
event->pos();
325 hBar->
setValue(hBar->
value() + (isRightToLeft() ? delta_move.
x() : -delta_move.
x()));
344 #ifdef GUI_DEBUG_GRID
345 debugShowLayouterGridpos(
event->pos());
355 mDragController->
enterDrag(
event->keyboardModifiers() == mDragModifier);
356 event->acceptProposedAction();
368 mDragController->
clear();
371 void GraphGraphicsView::dragPan(
float dpx,
float dpy)
376 int hValue = hBar->
value() + 10*dpx;
377 if (hValue < hBar->minimum()) hBar->
setMinimum(hValue);
384 int vValue = vBar->
value() + 10*dpy;
385 if (vValue < vBar->minimum()) vBar->
setMinimum(vValue);
397 mDragController->
move(
event->pos(),
event->keyboardModifiers() == mDragModifier,snap.first);
405 if (rx < 10) dpx = -10+rx;
406 if (rx > 90) dpx = rx-90;
407 if (ry < 10) dpy = -10+ry;
408 if (ry > 90) dpy = ry-90;
409 if (dpx !=0 || dpy != 0)
418 event->acceptProposedAction();
424 assert(layouter->
done());
435 mDragController->
clear();
444 qreal angle =
event->angleDelta().y();
445 qreal factor = qPow(mZoomFactorBase, angle);
453 switch (
event->key())
466 switch (
event->key())
483 void GraphGraphicsView::showContextMenu(
const QPoint& pos)
490 QMenu context_menu(
this);
495 bool isModule =
false;
542 if (isGate || isModule)
544 QMenu* preSucMenu = context_menu.
addMenu(
"Successor/Predecessor …");
545 recursionLevelMenu(preSucMenu->
addMenu(
"Add successors to view …"),
true, &GraphGraphicsView::handleAddSuccessorToView);
547 recursionLevelMenu(preSucMenu->
addMenu(
"Add common successors to view …"),
true, &GraphGraphicsView::handleAddCommonSuccessorToView);
554 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight successors …"),
true, &GraphGraphicsView::handleHighlightSuccessor,
true);
555 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight successors by distance …"),
true, &GraphGraphicsView::handleSuccessorDistance);
564 recursionLevelMenu(preSucMenu->
addMenu(
"Add predecessors to view …"),
false, &GraphGraphicsView::handleAddPredecessorToView);
566 recursionLevelMenu(preSucMenu->
addMenu(
"Add common predecessors to view …"),
false, &GraphGraphicsView::handleAddCommonPredecessorToView);
573 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight predecessors …"),
false, &GraphGraphicsView::handleHighlightPredecessor,
true);
574 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight predecessors by distance …"),
false, &GraphGraphicsView::handlePredecessorDistance);
583 action = context_menu.addAction(
"Remove selected items from view");
588 action = context_menu.addAction(
"Cancel pick-item mode");
600 if(isGate || isModule)
602 action = context_menu.addAction(
" Fold parent module");
607 action = context_menu.addAction(
" Unfold module");
616 action = context_menu.addAction(
" Fold all parent modules");
618 action = context_menu.addAction(
" Isolate all in new view");
620 action = context_menu.addAction(
" Unfold all selected modules");
623 action = context_menu.addAction(
" Add comment");
625 data.setValue(Node(mItem->
id(), isGate ? Node::NodeType::Gate : Node::NodeType::Module));
632 context_menu.addAction(
"This view:")->setEnabled(
false);
634 action = context_menu.addAction(
" Add module to view");
637 int selectable_modules_count = 0;
638 QSet<u32> not_selectable_modules = getNotSelectableModules();
641 if (!not_selectable_modules.
contains(m->get_id()))
642 selectable_modules_count++;
644 if (selectable_modules_count == 0)
645 action->setDisabled(
true);
647 action = context_menu.addAction(
" Add gate to view");
649 if (getSelectableGates().empty())
650 action->setDisabled(
true);
674 void GraphGraphicsView::handlePluginContextContributionTriggered()
678 ContextMenuContribution* cmc =
static_cast<ContextMenuContribution*
>(act->
data().
value<
void*>());
680 Q_ASSERT(cmc->mContributer);
681 cmc->mContributer->execute_function(cmc->mTagname,
gNetlist,
689 void GraphGraphicsView::updateMatrix(
const int delta)
691 qreal
scale = qPow(2.0, delta / 100.0);
698 void GraphGraphicsView::toggleAntialiasing()
703 bool GraphGraphicsView::itemDraggable(GraphicsItem* item)
711 scale(factor, factor);
721 scale(factor, factor);
725 void GraphGraphicsView::handleCancelPickMode()
730 namespace ShortestPath
743 const Module* parent =
g->get_module();
756 void GraphGraphicsView::handleAddModuleToView()
758 GraphContext* context = mGraphWidget->
getContext();
827 ModuleDialog module_dialog(getNotSelectableModules(),
"Add module to view",
true,
nullptr,
this);
831 module_to_add.
insert(module_dialog.selectedId());
832 ActionAddItemsToObject* act =
new ActionAddItemsToObject(module_to_add, {});
839 QSet<u32> GraphGraphicsView::getNotSelectableModules()
841 GraphContext* context = mGraphWidget->
getContext();
844 QSet<u32> modules_in_context = context->modules();
845 QSet<u32> gates_in_context = context->gates();
849 bool module_in_context =
false;
852 if (modules_in_context.
contains(submodule->get_id()))
854 module_in_context =
true;
860 if (gates_in_context.
contains(subgate->get_id()))
862 module_in_context =
true;
866 if (module_in_context)
872 not_selectable_modules += modules_in_context;
875 for (
u32 id : modules_in_context)
883 if (!cur_module->is_top_module())
885 direct_par_modules.
insert(cur_module->get_parent_module()->get_id());
889 if (!gates_in_context.
empty())
891 for (
u32 id : gates_in_context)
897 for (
u32 id : direct_par_modules)
899 not_selectable_modules.
insert(
id);
902 while (!tmp_module->is_top_module())
904 Module* par_module = tmp_module->get_parent_module();
905 tmp_module = par_module;
906 not_selectable_modules.
insert(par_module->get_id());
910 return not_selectable_modules;
913 QSet<u32> GraphGraphicsView::getSelectableGates()
915 GraphContext* context = mGraphWidget->
getContext();
917 QSet<u32> not_selectable_gates = context->gates();
918 QSet<u32> modules_in_context = context->modules();
920 for (
u32 module_id : modules_in_context)
924 not_selectable_gates.
insert(gate->get_id());
931 if (!not_selectable_gates.
contains(gate->get_id()))
933 selectable_gates.
insert(gate->get_id());
937 return selectable_gates;
940 void GraphGraphicsView::handleAddGateToView()
942 QSet<u32> selectable_gates = getSelectableGates();
944 GraphContext* context = mGraphWidget->
getContext();
946 GateDialog gate_dialog(selectable_gates,
"Add gate to view",
nullptr,
this);
950 gate_to_add.
insert(gate_dialog.selectedId());
951 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gate_to_add);
958 void GraphGraphicsView::handleAddSuccessorToView()
963 addSuccessorToView(level,
true);
966 void GraphGraphicsView::handleAddPredecessorToView()
971 addSuccessorToView(level,
false);
974 void GraphGraphicsView::handleAddCommonSuccessorToView()
979 addCommonSuccessorToView(level,
true);
982 void GraphGraphicsView::handleAddCommonPredecessorToView()
987 addCommonSuccessorToView(level,
false);
990 void GraphGraphicsView::addSuccessorToView(
int maxLevel,
bool succ)
1014 Q_ASSERT(startList.
size());
1016 for (
const Gate*
g : startList)
1020 const NodeBox* box = boxes.
boxForNode(startNode);
1022 int xOrigin = box->x();
1023 int yOrigin = box->y();
1024 int xDir = succ ? 1 : -1;
1028 for (
int loop = 0; !maxLevel || loop<maxLevel; loop++)
1033 for (
const Gate* gOrigin : startList)
1039 if (boxes.boxForGate(
g))
continue;
1044 if (foundList.
isEmpty())
break;
1045 for (
const Gate*
g: foundList)
1048 QPoint point(xOrigin + (loop+1) * xDir, yOrigin +
y);
1049 y =
y > 0 ? -
y : -
y+1;
1051 if (!boxes.boxForPoint(point))
1055 plc.addGridPosition(nd,point);
1058 startList = foundList;
1061 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gatsNew);
1063 act->setPlacementHint(plc);
1068 void GraphGraphicsView::addCommonSuccessorToView(
int maxLevel,
bool succ)
1074 for (
const Gate*
g : csp.result())
1076 if (boxes.boxForGate(
g))
continue;
1079 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gatsNew);
1084 void GraphGraphicsView::handleHighlightSuccessor()
1092 void GraphGraphicsView::handleHighlightPredecessor()
1100 void GraphGraphicsView::handleSuccessorDistance()
1108 void GraphGraphicsView::handlePredecessorDistance()
1116 void GraphGraphicsView::handleShortestPathToView()
1128 selectableGates.
insert(
g->get_id());
1132 GateDialog gd(selectableGates,
QString(
"Shortest path %1 gate").arg(succ?
"to":
"from"),
nullptr,
this);
1139 std::vector<Gate*> spath;
1145 std::reverse(spath.begin(), spath.end());
1147 if (spath.empty())
return;
1148 auto it = spath.begin() + 1;
1150 const NodeBox* lastBox = boxes.
boxForGate(gOrigin);
1152 QPoint point(lastBox->x(),lastBox->y());
1153 QPoint deltaX(succ ? 1 : -1, 0);
1158 while (it != spath.end())
1162 if (boxes.boxForGate(
g))
continue;
1165 if (!boxes.boxForPoint(point))
1169 plc.addGridPosition(nd,point);
1174 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gats);
1176 act->setPlacementHint(plc);
1180 void GraphGraphicsView::handleQueryShortestPath()
1188 selectableGates.
insert(
g->get_id());
1190 GraphGraphicsViewNeighborSelector* ggvns =
new GraphGraphicsViewNeighborSelector(mItem->
id(), succ,
this);
1191 GateDialog gd(selectableGates,
QString(
"Shortest path %1 gate").arg(succ?
"to":
"from"),ggvns,
this);
1195 u32 targetId = gd.selectedId();
1196 if (!targetId)
return;
1216 Gate* previousGate =
nullptr;
1217 for (
Gate*
g : spath)
1233 QString(
"Path from %1[%2] to %3[%4]")
1241 void GraphGraphicsView::handleSelectOutputs()
1251 for (
auto net : gate->get_fan_out_nets())
1253 for (
const auto& suc :
net->get_destinations())
1256 for (
const auto&
id : context->modules())
1259 if (m->contains_gate(suc->get_gate(),
true))
1267 gates.
insert(suc->get_gate()->get_id());
1277 for (
const auto& suc :
net->get_destinations())
1280 for (
const auto&
id : context->modules())
1283 if (m->contains_gate(suc->get_gate(),
true))
1291 gates.
insert(suc->get_gate()->get_id());
1297 gates = context->getLayouter()->boxes().filterNotInView(gates);
1298 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gates);
1310 void GraphGraphicsView::handleSelectInputs()
1320 for (
auto net : gate->get_fan_in_nets())
1322 if (!
net->get_sources().empty() &&
net->get_sources().at(0)->get_gate() !=
nullptr)
1325 for (
const auto&
id : context->modules())
1328 if (m->contains_gate(
net->get_sources().at(0)->get_gate(),
true))
1336 gates.
insert(
net->get_sources().at(0)->get_gate()->get_id());
1346 if (!
net->get_sources().empty() &&
net->get_sources().at(0)->get_gate() !=
nullptr)
1349 for (
const auto&
id : context->modules())
1352 if (m->contains_gate(
net->get_sources().at(0)->get_gate(),
true))
1360 gates.
insert(
net->get_sources().at(0)->get_gate()->get_id());
1366 gates = context->getLayouter()->boxes().filterNotInView(gates);
1367 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gates);
1380 void GraphGraphicsView::selectedNodeToItem()
1383 NodeBox* box =
nullptr;
1395 mItem = box->item();
1400 selectedNodeToItem();
1402 handleFoldParentSingle();
1407 selectedNodeToItem();
1409 handleUnfoldSingleAction();
1412 void GraphGraphicsView::handleFoldParentSingle()
1414 const Module* parentModule =
nullptr;
1416 u32 id = mItem->
id();
1438 ActionFoldModule* act =
new ActionFoldModule(parentModule->
get_id());
1439 act->setContextId(context->
id());
1440 act->setPlacementHint(plc);
1444 void GraphGraphicsView::handleUnfoldSingleAction()
1446 GraphContext* context = mGraphWidget->
getContext();
1448 if (m->get_gates().empty() && m->get_submodules().empty())
1451 msg.
setText(
"This module is empty.\nYou can't unfold it.");
1458 ActionUnfoldModule* act =
new ActionUnfoldModule(mItem->
id());
1459 act->setContextId(context->id());
1463 void GraphGraphicsView::handleFoldParentAll()
1465 GraphContext* context = mGraphWidget->
getContext();
1471 if (!context->getLayouter()->boxes().boxForNode(nd))
continue;
1486 for (
const Module* m : modSet)
1487 if (m) modDepth.
insertMulti(m->get_submodule_depth(),m);
1491 while (it.hasPrevious())
1494 const Module* m = it.value();
1495 ActionFoldModule* act =
new ActionFoldModule(m->get_id());
1496 act->setContextId(context->id());
1501 void GraphGraphicsView::handleUnfoldAllAction()
1506 UserActionCompound* act =
new UserActionCompound;
1509 ActionUnfoldModule* ufo =
new ActionUnfoldModule(
id);
1510 ufo->setContextId(context->id());
1511 act->addAction(ufo);
1514 context->endChange();
1517 #ifdef GUI_DEBUG_GRID
1518 void GraphGraphicsView::debugShowLayouterGridpos(
const QPoint& mouse_pos)
1524 const GraphLayouter* layouter = context->
getLayouter();
1525 if (!(layouter->done()))
1529 QPoint layouter_pos = closestLayouterPos(scene_mouse_pos).first;
1530 m_debug_gridpos = layouter_pos;
1539 const GraphLayouter* layouter = context->getLayouter();
1540 assert(layouter->done());
1542 int default_width = layouter->defaultGridWidth();
1543 int default_height = layouter->defaultGridHeight();
1544 int min_x = layouter->minXIndex();
1545 int min_y = layouter->minYIndex();
1548 LayouterPoint x_point = closestLayouterPoint(scene_pos.
x(), default_width, min_x, x_vals);
1549 LayouterPoint y_point = closestLayouterPoint(scene_pos.
y(), default_height, min_y, y_vals);
1550 return qMakePair(
QPoint(x_point.mIndex, y_point.mIndex),
QPointF(x_point.mPos, y_point.mPos));
1553 GraphGraphicsView::LayouterPoint GraphGraphicsView::closestLayouterPoint(qreal scene_pos,
int default_spacing,
int min_index,
QVector<qreal> sections)
const
1555 int index = min_index;
1557 if (sections.
first() > scene_pos)
1559 int distance = sections.
first() - scene_pos;
1560 int nSections = distance / default_spacing;
1561 index -= (nSections + 1);
1562 pos = sections.
first() + index * default_spacing;
1564 else if (sections.
last() <= scene_pos)
1566 int distance = scene_pos - sections.
last();
1567 int nSections = distance / default_spacing;
1568 index += (sections.
size() + nSections -1);
1569 pos = sections.
last() + nSections * default_spacing;
1578 if (scene_pos < *jt)
break;
1585 return LayouterPoint{index,
pos};
1601 return mDragModifier;
1611 return mPanModifier;
Adds an item to a module or grouping.
Removes an item from a Module or Grouping.
Set the selection and focus.
GraphTabWidget * getGraphTabWidget()
Get hal's graph tab widget.
GroupingManagerWidget * getGroupingManagerWidget()
ContextManagerWidget * getContextManagerWidget()
void selectViewContext(GraphContext *context)
GraphContext * getCurrentContext()
void handleOpenContextClicked()
GridPlacement * finalGridPlacement() const
void move(const QPoint &eventPos, bool wantSwap, const QPoint &gridPos)
bool hasDragged(const QPoint &eventPos)
void set(GraphicsNode *drgItem, const QPoint &eventPos)
bool isDropAllowed() const
void enterDrag(bool wantSwap)
const std::vector< Net * > & get_fan_in_nets() const
const std::string & get_name() const
Module * get_module() const
const std::vector< Net * > & get_fan_out_nets() const
Logical container for modules, gates, and nets.
const QSet< u32 > & gates() const
const QSet< u32 > & modules() const
GraphLayouter * getLayouter() const
QString nextViewName(const QString &prefix) const
GraphContext * getContextById(u32 id) const
GraphContext * getContextByExclusiveModuleId(u32 module_id) const
static SettingsItemCheckbox * sSettingPanOnMiddleButton
A view to display the rendered graph (needs a GraphicsScene).
void handleRemoveFromView()
void keyPressEvent(QKeyEvent *event) override
void dragLeaveEvent(QDragLeaveEvent *event) override
void setGridType(GraphicsScene::GridType gridType)
void dropEvent(QDropEvent *event) override
void wheelEvent(QWheelEvent *event) override
void setPanModifier(Qt::KeyboardModifier panModifier)
Qt::KeyboardModifier panModifier()
void keyReleaseEvent(QKeyEvent *event) override
void viewportCenterZoom(const qreal factor)
void setDragModifier(Qt::KeyboardModifier dragModifier)
GraphGraphicsView(GraphWidget *parent)
void paintEvent(QPaintEvent *event) override
void moduleDoubleClicked(u32 id)
void mouseMoveEvent(QMouseEvent *event) override
Qt::KeyboardModifier dragModifier()
void resizeEvent(QResizeEvent *event) override
void handleFoldModuleShortcut()
GraphicsScene::GridType gridType()
void dragEnterEvent(QDragEnterEvent *event) override
void handleShortestPath(u32 idFrom, u32 idTo)
void mouseDoubleClickEvent(QMouseEvent *event) override
void mouseReleaseEvent(QMouseEvent *event) override
void mousePressEvent(QMouseEvent *event) override
void handleUnfoldModuleShortcut()
void drawForeground(QPainter *painter, const QRectF &rect) override
void gentleZoom(const qreal factor)
void dragMoveEvent(QDragMoveEvent *event) override
void handleGatesPicked(const QSet< u32 > &gats) override
Base class for all specific layouters.
const NodeBoxes & boxes() const
Superclass for all graphic items used ins the GraphicsScene. It contains information about the underl...
static void setLod(const qreal lod)
ItemType itemType() const
Abstract base class for nodes (e.g. gates, modules)
Container for a GraphGraphicsView containing gates, nets, and modules.
static void setLod(const qreal &lod)
void setMousePressed(bool isPressed)
static void setGridEnabled(const bool &value)
static void setGridType(const GridType &gridType)
static void setGridClustersEnabled(const bool &value)
static void addPluginSubmenus(QMenu *contextMenu, Netlist *netlist, const std::vector< u32 > &modules, const std::vector< u32 > &gates, const std::vector< u32 > &nets)
Module * get_parent_module() const
const std::vector< Gate * > & get_gates() const
std::string get_name() const
const std::unordered_set< Net * > & get_input_nets() const
std::vector< Module * > get_submodules(const std::function< bool(Module *)> &filter=nullptr, bool recursive=false) const
const std::unordered_set< Net * > & get_output_nets() const
const std::vector< Gate * > & get_gates() const
Gate * get_gate_by_id(const u32 gate_id) const
const std::vector< Module * > & get_modules() const
Module * get_module_by_id(u32 module_id) const
The NodeBoxes class owns all NodeBox'es from hal view.
NodeBox * boxForNode(const Node &n) const
boxForNode find NodeBox by node
NodeBox * boxForGate(const Gate *g) const
boxForGate find NodeBox by Gate pointer.
static void setLod(const qreal lod)
The Node class object represents a module or a gate.
NodeType type() const
type getter for type information
int numberSelectedGates() const
int numberSelectedItems() const
bool containsGate(u32 id) const
void setFocus(ItemType ftype, u32 fid, Subfocus sfoc=Subfocus::None, u32 sfinx=0)
const QSet< u32 > & selectedNets() const
void relaySelectionChanged(void *sender)
QList< Node > selectedNodesList() const
QList< u32 > selectedModulesList() const
const QSet< u32 > & selectedGates() const
const QSet< u32 > & selectedModules() const
std::vector< u32 > selectedGatesVector() const
int numberSelectedModules() const
bool containsModule(u32 id) const
std::vector< u32 > selectedNetsVector() const
bool containsNet(u32 id) const
QList< u32 > selectedGatesList() const
std::vector< u32 > selectedModulesVector() const
void subfocusChanged(void *sender)
int numberSelectedNodes() const
static void updateAlpha()
virtual QVariant value() const override
static void updateAlpha()
static void updateAlpha()
static void updateAlpha()
void addAction(UserAction *act)
void setUseCreatedObject()
virtual void setObject(const UserActionObject &obj)
void setObjectLock(bool lock)
The UserActionObject class represents a single object used in UserAction.
ItemType
The ItemType enum provides the enum type to classify graphic items into Modules, Gates or Nets....
const Module * module(const Gate *g, const NodeBoxes &boxes)
const Net * net(const Gate *g0, const Gate *g1)
std::vector< Gate * > get_next_gates(const Gate *gate, bool get_successors, int depth, const std::function< bool(const Gate *)> &filter)
std::vector< Gate * > get_shortest_path(Gate *start_gate, Gate *end_gate, bool search_both_directions)
PythonContext * gPythonContext
ContentManager * gContentManager
GraphContextManager * gGraphContextManager
SelectionRelay * gSelectionRelay
CommentManager * gCommentManager
QVariant data() const const
void triggered(bool checked)
Qt::DropAction exec(Qt::DropActions supportedActions)
void setMimeData(QMimeData *data)
QMatrix matrix() const const
void setMatrix(const QMatrix &matrix, bool combine)
void centerOn(const QPointF &pos)
virtual void dropEvent(QDropEvent *event) override
virtual bool event(QEvent *event) override
QGraphicsItem * itemAt(const QPoint &pos) const const
QPoint mapFromScene(const QPointF &point) const const
QPointF mapToScene(const QPoint &point) const const
virtual void mouseMoveEvent(QMouseEvent *event) override
virtual void mousePressEvent(QMouseEvent *event) override
virtual void mouseReleaseEvent(QMouseEvent *event) override
void setOptimizationFlags(QGraphicsView::OptimizationFlags flags)
virtual void paintEvent(QPaintEvent *event) override
virtual void resizeEvent(QResizeEvent *event) override
void scale(qreal sx, qreal sy)
QGraphicsScene * scene() const const
void setRenderHint(QPainter::RenderHint hint, bool enabled)
void setViewportUpdateMode(QGraphicsView::ViewportUpdateMode mode)
Qt::KeyboardModifiers keyboardModifiers()
void append(const T &value)
const T & at(int i) const const
bool isEmpty() const const
QMap::iterator insertMulti(const Key &key, const T &value)
QMatrix & scale(qreal sx, qreal sy)
virtual int exec() override
void setWindowTitle(const QString &title)
void setText(const QString &text)
void setText(const QString &text)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
QObject * sender() const const
void drawText(const QPointF &position, const QString &text)
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setPen(const QColor &color)
QPoint toPoint() const const
QSet::const_iterator constBegin() const const
bool contains(const T &value) const const
QSet::iterator insert(const T &value)
bool isEmpty() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString fromStdString(const std::string &str)
QString number(int n, int base)
bool toBool() const const
int toInt(bool *ok) const const
QVector::const_iterator constBegin() const const
QVector::const_iterator constEnd() const const