Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
LibraryScene Class Reference

A custom QGraphicsScene for a library application. More...

#include <library_scene.h>

Inheritance diagram for LibraryScene:

Signals

void libraryNodeSelected (const QString &nodeType)
 Emitted when a library node is selected.

Public Member Functions

 LibraryScene (QObject *parent=nullptr)
 Constructs a new LibraryScene object.
QRectF visibleItemsBounds () const
 Returns the bounding rectangle of all visible items in the scene.
bool filterNodes (const QString &query)
 Filters nodes based on a query string.
void relayoutVisibleItems ()
 Relayouts the visible items in the scene.
void themeChanged ()
 Handles theme change events.

Protected Member Functions

void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 Handles mouse press events in the scene.
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 Handles mouse move events in the scene.
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 Handles mouse release events in the scene.
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override
 Handles context menu events in the scene.

Private Member Functions

void clearSelectedNodes ()
 Pointer to the item that was clicked.

Private Attributes

bool mPressed = false
 Scene position where mouse was pressed.
bool mDragging = false
 Flag indicating if mouse is currently pressed.
DraggableItem * mClickedItem
 Flag indicating if dragging is in progress.

Detailed Description

A custom QGraphicsScene for a library application.

Constructor & Destructor Documentation

◆ LibraryScene()

LibraryScene::LibraryScene ( QObject * parent = nullptr)

Constructs a new LibraryScene object.

Parameters
parentThe parent QObject, if any.

Member Function Documentation

◆ clearSelectedNodes()

void LibraryScene::clearSelectedNodes ( )
private

Pointer to the item that was clicked.

Clears all selected nodes from the scene.

◆ contextMenuEvent()

void LibraryScene::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event)
overrideprotected

Handles context menu events in the scene.

Parameters
eventThe QGraphicsSceneContextMenuEvent object.

◆ filterNodes()

bool LibraryScene::filterNodes ( const QString & query)

Filters nodes based on a query string.

Parameters
queryThe query string to filter nodes by.
Returns
bool True if any nodes were filtered, false otherwise.

◆ libraryNodeSelected

void LibraryScene::libraryNodeSelected ( const QString & nodeType)
signal

Emitted when a library node is selected.

Parameters
nodeTypeThe type of the selected node.

◆ mouseMoveEvent()

void LibraryScene::mouseMoveEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

Handles mouse move events in the scene.

Parameters
eventThe QGraphicsSceneMouseEvent object.

◆ mousePressEvent()

void LibraryScene::mousePressEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

Handles mouse press events in the scene.

Parameters
eventThe QGraphicsSceneMouseEvent object.

◆ mouseReleaseEvent()

void LibraryScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

Handles mouse release events in the scene.

Parameters
eventThe QGraphicsSceneMouseEvent object.

◆ visibleItemsBounds()

QRectF LibraryScene::visibleItemsBounds ( ) const

Returns the bounding rectangle of all visible items in the scene.

Returns
QRectF The bounding rectangle.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/system/library_scene.h
  • /__w/maki/maki/app/system/library_scene.cpp