![]() |
HAL
|
A view to display the rendered graph (needs a GraphicsScene). More...
#include <graph_graphics_view.h>
Public Slots | |
void | handleShortestPath (u32 idFrom, u32 idTo) |
void | handleRemoveFromView () |
Signals | |
void | moduleDoubleClicked (u32 id) |
void | triggerTerminatePicker () |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) override |
void | drawForeground (QPainter *painter, const QRectF &rect) override |
void | mousePressEvent (QMouseEvent *event) override |
void | mouseMoveEvent (QMouseEvent *event) override |
void | mouseReleaseEvent (QMouseEvent *event) override |
void | mouseDoubleClickEvent (QMouseEvent *event) override |
void | dragEnterEvent (QDragEnterEvent *event) override |
void | dragLeaveEvent (QDragLeaveEvent *event) override |
void | dragMoveEvent (QDragMoveEvent *event) override |
void | dropEvent (QDropEvent *event) override |
void | wheelEvent (QWheelEvent *event) override |
void | keyPressEvent (QKeyEvent *event) override |
void | keyReleaseEvent (QKeyEvent *event) override |
void | resizeEvent (QResizeEvent *event) override |
![]() | |
virtual void | setupViewport (QWidget *widget) override |
virtual bool | event (QEvent *event) override |
virtual bool | viewportEvent (QEvent *event) override |
virtual void | contextMenuEvent (QContextMenuEvent *event) override |
virtual void | focusInEvent (QFocusEvent *event) override |
virtual bool | focusNextPrevChild (bool next) override |
virtual void | focusOutEvent (QFocusEvent *event) override |
virtual void | scrollContentsBy (int dx, int dy) override |
virtual void | showEvent (QShowEvent *event) override |
virtual void | inputMethodEvent (QInputMethodEvent *event) override |
virtual void | drawBackground (QPainter *painter, const QRectF &rect) |
virtual void | drawItems (QPainter *painter, int numItems, QGraphicsItem *[] items, const QStyleOptionGraphicsItem[] options) |
![]() | |
void | setViewportMargins (int left, int top, int right, int bottom) |
void | setViewportMargins (const QMargins &margins) |
QMargins | viewportMargins () const const |
virtual QSize | viewportSizeHint () const const |
![]() | |
virtual void | changeEvent (QEvent *ev) override |
void | initStyleOption (QStyleOptionFrame *option) const const |
![]() | |
virtual void | enterEvent (QEvent *event) |
virtual void | leaveEvent (QEvent *event) |
virtual void | moveEvent (QMoveEvent *event) |
virtual void | closeEvent (QCloseEvent *event) |
virtual void | tabletEvent (QTabletEvent *event) |
virtual void | actionEvent (QActionEvent *event) |
virtual void | hideEvent (QHideEvent *event) |
virtual bool | nativeEvent (const QByteArray &eventType, void *message, long *result) |
virtual int | metric (QPaintDevice::PaintDeviceMetric m) const const override |
virtual void | initPainter (QPainter *painter) const const override |
void | updateMicroFocus () |
void | create (WId window, bool initializeWindow, bool destroyOldWindow) |
void | destroy (bool destroyWindow, bool destroySubWindows) |
bool | focusNextChild () |
bool | focusPreviousChild () |
![]() | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
![]() | |
QPaintDevice () | |
Friends | |
class | GraphWidget |
A view to display the rendered graph (needs a GraphicsScene).
The GraphGraphicsView is the GraphicsView for a GraphicsScene. (Its like the camera that shows a section of the scene)
Definition at line 70 of file graph_graphics_view.h.
hal::GraphGraphicsView::GraphGraphicsView | ( | GraphWidget * | parent | ) |
Constructor.
parent | - The parent GraphWidget |
Definition at line 75 of file graph_graphics_view.cpp.
References QObject::connect(), Qt::CustomContextMenu, QWidget::customContextMenuRequested(), QGraphicsView::DontSavePainterState, QGraphicsView::FullViewportUpdate, hal::gSelectionRelay, QWidget::setAcceptDrops(), QWidget::setContextMenuPolicy(), QWidget::setMouseTracking(), QGraphicsView::setOptimizationFlags(), QGraphicsView::setViewportUpdateMode(), and hal::SelectionRelay::subfocusChanged().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 351 of file graph_graphics_view.cpp.
References hal::DragController::enterDrag(), QGraphicsView::event(), and Qt::MoveAction.
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 365 of file graph_graphics_view.cpp.
References hal::DragController::clear(), and QGraphicsView::event().
Qt::KeyboardModifier hal::GraphGraphicsView::dragModifier | ( | ) |
Definition at line 1599 of file graph_graphics_view.cpp.
Referenced by setDragModifier().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 391 of file graph_graphics_view.cpp.
References QGraphicsView::event(), QWidget::geometry, QGraphicsView::mapToScene(), hal::DragController::move(), Qt::MoveAction, QAbstractScrollArea::viewport(), QPoint::x(), and QPoint::y().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 232 of file graph_graphics_view.cpp.
References QPainter::fillRect(), hal::GraphWidget::getContext(), QWidget::height, QWidget::rect, QPainter::resetTransform(), hal::GraphContext::scene(), QAbstractScrollArea::viewport(), and QWidget::width.
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 414 of file graph_graphics_view.cpp.
References hal::DragController::clear(), hal::GraphLayouter::done(), QGraphicsView::dropEvent(), QGraphicsView::event(), hal::ActionMoveNode::exec(), hal::DragController::finalGridPlacement(), hal::GraphWidget::getContext(), hal::GraphContext::getLayouter(), hal::GraphContext::id(), hal::DragController::isDropAllowed(), Qt::MoveAction, and hal::GraphContext::setDirty().
void hal::GraphGraphicsView::gentleZoom | ( | const qreal | factor | ) |
Zoom in/out at the position of the mouse.
factor | - The new zoom factor |
Definition at line 709 of file graph_graphics_view.cpp.
References QGraphicsView::centerOn(), QWidget::height, QGraphicsView::mapFromScene(), QGraphicsView::mapToScene(), QGraphicsView::scale(), QPointF::toPoint(), QAbstractScrollArea::viewport(), and QWidget::width.
Referenced by wheelEvent().
GraphicsScene::GridType hal::GraphGraphicsView::gridType | ( | ) |
Definition at line 1589 of file graph_graphics_view.cpp.
Referenced by setGridType().
void hal::GraphGraphicsView::handleFoldModuleShortcut | ( | ) |
Definition at line 1398 of file graph_graphics_view.cpp.
|
slot |
remove selected nodes from view
Definition at line 102 of file graph_graphics_view.cpp.
References hal::UserActionCompound::addAction(), hal::UserActionObjectType::ContextView, hal::ActionRemoveItemsFromObject::exec(), hal::UserActionCompound::exec(), hal::GraphContext::gates(), hal::gContentManager, hal::ContentManager::getContextManagerWidget(), hal::ContextManagerWidget::getCurrentContext(), hal::gSelectionRelay, hal::GraphContext::id(), QSet::isEmpty(), hal::GraphContext::modules(), hal::SelectionRelay::selectedGates(), hal::SelectionRelay::selectedModules(), hal::UserAction::setObject(), hal::UserAction::setObjectLock(), and hal::UserActionCompound::setUseCreatedObject().
highlight shortest path between two gates by putting the items on path into a new group
idFrom | - id of gate where path starts |
idTo | - id of gate where path ends |
Definition at line 1204 of file graph_graphics_view.cpp.
References hal::UserActionCompound::addAction(), QString::arg(), hal::GraphLayouter::boxes(), hal::UserActionCompound::exec(), QString::fromStdString(), test_plugin::g, hal::Netlist::get_gate_by_id(), hal::Gate::get_id(), hal::Module::get_id(), hal::Gate::get_name(), hal::netlist_utils::get_shortest_path(), hal::GraphWidget::getContext(), hal::GraphContext::getLayouter(), hal::gNetlist, hal::UserActionObjectType::Grouping, QSet::insert(), hal::ShortestPath::module(), test::n, hal::ShortestPath::net(), and hal::UserActionCompound::setUseCreatedObject().
Referenced by hal::GraphGraphicsViewNeighborSelector::handleGatesPicked().
void hal::GraphGraphicsView::handleUnfoldModuleShortcut | ( | ) |
Definition at line 1405 of file graph_graphics_view.cpp.
References hal::GraphicsItem::itemType(), and hal::Module.
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 451 of file graph_graphics_view.cpp.
References QGraphicsView::event(), and Qt::Key_Space.
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 464 of file graph_graphics_view.cpp.
References QGraphicsView::event(), and Qt::Key_Space.
|
signal |
Q_SIGNAL that is emitted whenever the user double-clicks a module in the current view.
Note that this signal is not emitted for double-clicks on gates or nets.
id | - The id of the module that was double clicked. |
Referenced by hal::GraphWidget::GraphWidget(), and mouseDoubleClickEvent().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 209 of file graph_graphics_view.cpp.
References QGraphicsView::event(), hal::GraphicsItem::id(), QGraphicsView::itemAt(), hal::GraphicsItem::itemType(), Qt::LeftButton, hal::Module, moduleDoubleClicked(), hal::CommentSpeechBubble::mouseDoubleClickEvent(), and QObject::Q_EMIT().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 305 of file graph_graphics_view.cpp.
References QGraphicsView::event(), QDrag::exec(), hal::gGraphContextManager, hal::DragController::hasDragged(), QAbstractScrollArea::horizontalScrollBar(), Qt::LeftButton, QGraphicsView::mapToScene(), Qt::MidButton, QGraphicsView::mouseMoveEvent(), Qt::MoveAction, QGraphicsView::scene(), QDrag::setMimeData(), QMimeData::setText(), QAbstractSlider::setValue(), hal::GraphContextManager::sSettingPanOnMiddleButton, QVariant::toBool(), QAbstractSlider::value, hal::SettingsItemCheckbox::value(), QAbstractScrollArea::verticalScrollBar(), QPointF::x(), QPoint::x(), QPointF::y(), and QPoint::y().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 259 of file graph_graphics_view.cpp.
References hal::DragController::clear(), QGraphicsView::event(), hal::gGraphContextManager, QGraphicsView::itemAt(), Qt::LeftButton, Qt::MidButton, hal::DragController::set(), hal::GraphContextManager::sSettingPanOnMiddleButton, QVariant::toBool(), and hal::SettingsItemCheckbox::value().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 298 of file graph_graphics_view.cpp.
References QGraphicsView::event(), QGraphicsView::mouseReleaseEvent(), QGraphicsView::scene(), and hal::GraphicsScene::setMousePressed().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 188 of file graph_graphics_view.cpp.
References QGraphicsView::event(), QStyleOptionGraphicsItem::levelOfDetailFromTransform(), QGraphicsView::paintEvent(), hal::GraphicsScene::setGridClustersEnabled(), hal::GraphicsScene::setGridEnabled(), hal::GraphicsScene::setGridType(), hal::GraphicsScene::setLod(), hal::GraphicsItem::setLod(), hal::NodeDragShadow::setLod(), QGraphicsView::transform(), hal::SeparatedGraphicsNet::updateAlpha(), hal::StandardGraphicsNet::updateAlpha(), hal::StandardGraphicsGate::updateAlpha(), and hal::StandardGraphicsModule::updateAlpha().
Qt::KeyboardModifier hal::GraphGraphicsView::panModifier | ( | ) |
Definition at line 1609 of file graph_graphics_view.cpp.
Referenced by setPanModifier().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 477 of file graph_graphics_view.cpp.
References QGraphicsView::event(), and QGraphicsView::resizeEvent().
void hal::GraphGraphicsView::setDragModifier | ( | Qt::KeyboardModifier | dragModifier | ) |
Definition at line 1604 of file graph_graphics_view.cpp.
References dragModifier().
void hal::GraphGraphicsView::setGridType | ( | GraphicsScene::GridType | gridType | ) |
Definition at line 1594 of file graph_graphics_view.cpp.
References gridType().
void hal::GraphGraphicsView::setPanModifier | ( | Qt::KeyboardModifier | panModifier | ) |
Definition at line 1614 of file graph_graphics_view.cpp.
References panModifier().
|
signal |
Q_SIGNAL that gets emitted to close all picker
void hal::GraphGraphicsView::viewportCenterZoom | ( | const qreal | factor | ) |
Zoom in/out at the center of the viewport.
factor | - The new zoom factor |
Definition at line 718 of file graph_graphics_view.cpp.
References QGraphicsView::centerOn(), QGraphicsView::mapToScene(), QWidget::rect, QGraphicsView::scale(), QPointF::toPoint(), and QAbstractScrollArea::viewport().
|
overrideprotectedvirtual |
Reimplemented from QGraphicsView.
Definition at line 438 of file graph_graphics_view.cpp.
References QGraphicsView::event(), gentleZoom(), QGuiApplication::keyboardModifiers(), and Qt::Vertical.
|
friend |
Definition at line 74 of file graph_graphics_view.h.