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

A custom QGraphicsView for managing a library of nodes. More...

#include <library_container.h>

Inheritance diagram for LibraryContainer:

Public Member Functions

 LibraryContainer (QWidget *parent=nullptr)
 Constructs a new LibraryContainer with the given parent widget.
VoidResult addNode (const QString &id, std::shared_ptr< NodeConfig > config)
 Adds a node with the given ID and configuration to the library.
bool filterNodes (const QString &query)
 Filters nodes based on the given query string.
void setColumnCount (int count)
 Update the number of columns in the library.

Static Public Member Functions

static LibraryContainer * create (const QString &name, QWidget *parent)
 Creates and returns a new LibraryContainer instance with the specified name and parent widget.

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 Handles resize events for the LibraryContainer.

Private Member Functions

void updateSceneSize ()
 Updates the size of the scene based on the current view size.
void relayoutItems ()
 Update layout after a column change.

Private Attributes

int mColumnCount = 2
 The last Y position of an item in the scene.

Detailed Description

A custom QGraphicsView for managing a library of nodes.

Constructor & Destructor Documentation

◆ LibraryContainer()

LibraryContainer::LibraryContainer ( QWidget * parent = nullptr)

Constructs a new LibraryContainer with the given parent widget.

Parameters
parentThe parent widget.

Member Function Documentation

◆ addNode()

VoidResult LibraryContainer::addNode ( const QString & id,
std::shared_ptr< NodeConfig > config )

Adds a node with the given ID and configuration to the library.

Parameters
idThe unique identifier for the node.
configThe configuration for the node.
Returns
A VoidResult indicating success or failure.

◆ create()

LibraryContainer * LibraryContainer::create ( const QString & name,
QWidget * parent )
static

Creates and returns a new LibraryContainer instance with the specified name and parent widget.

Parameters
nameThe name of the library container.
parentThe parent widget.
Returns
A pointer to the newly created LibraryContainer instance.

◆ filterNodes()

bool LibraryContainer::filterNodes ( const QString & query)

Filters nodes based on the given query string.

Parameters
queryThe query string used to filter nodes.
Returns
true if any nodes were filtered; false otherwise.

◆ resizeEvent()

void LibraryContainer::resizeEvent ( QResizeEvent * event)
overrideprotected

Handles resize events for the LibraryContainer.

Parameters
eventThe resize event.

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