wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
SceneUiBinder Class Reference

Binds and unbinds the active WorkSpace's scene to the single-instance editor chrome (element editor, Edit-menu undo/redo, scene-property shortcuts, and the zoom/mute/play action state). More...

#include <SceneUiBinder.h>

Inheritance diagram for SceneUiBinder:
[legend]

Public Member Functions

void bind (WorkSpace *tab)
 Connects tab's scene/view/simulation to the chrome and syncs action state.
void loadFileRequested (const QString &filePath)
 The bound scene asked to open a file-based IC by path (forwarded to the tab owner).
void openICRequested (const QString &blobName, int icElementId, const QByteArray &blob)
 The bound scene asked to open an embedded IC in a tab (forwarded to the tab owner).
 SceneUiBinder (MainWindowUi *ui, ElementPalette *palette, ICPreviewPopup *previewPopup, QWidget *shortcutParent, QObject *parent=nullptr)
void unbind ()
 Tears down the connections established by bind() for the currently bound tab.

Detailed Description

Binds and unbinds the active WorkSpace's scene to the single-instance editor chrome (element editor, Edit-menu undo/redo, scene-property shortcuts, and the zoom/mute/play action state).

Extracted from MainWindow. The chrome widgets are shared singletons that must be re-pointed at the current scene on every tab switch; that wiring is this class's sole responsibility. It owns the six scene-property QShortcuts (which only ever target the active scene). Tab navigation triggered by scene signals (icOpenRequested) and the file-based IC list stay with the tab owner.

Definition at line 34 of file SceneUiBinder.h.

Constructor & Destructor Documentation

◆ SceneUiBinder()

SceneUiBinder::SceneUiBinder ( MainWindowUi * ui,
ElementPalette * palette,
ICPreviewPopup * previewPopup,
QWidget * shortcutParent,
QObject * parent = nullptr )
Parameters
uiShared UI (element editor, menus, actions, status bar).
paletteElement palette (embedded-IC list reflects the active scene).
previewPopupShared IC hover-preview popup, driven off the bound scene's IC signals.
shortcutParentWidget that parents the scene-property shortcuts (the window).

Definition at line 26 of file SceneUiBinder.cpp.

Member Function Documentation

◆ bind()

void SceneUiBinder::bind ( WorkSpace * tab)

Connects tab's scene/view/simulation to the chrome and syncs action state.

Definition at line 122 of file SceneUiBinder.cpp.

References Scene::circuitHasChanged(), qCDebug, WorkSpace::scene(), Scene::showStatusMessageRequested(), WorkSpace::simulation(), Simulation::simulationWarning(), WorkSpace::view(), and GraphicsView::zoomChanged().

◆ loadFileRequested()

void SceneUiBinder::loadFileRequested ( const QString & filePath)

The bound scene asked to open a file-based IC by path (forwarded to the tab owner).

Referenced by MainWindow::MainWindow().

◆ openICRequested()

void SceneUiBinder::openICRequested ( const QString & blobName,
int icElementId,
const QByteArray & blob )

The bound scene asked to open an embedded IC in a tab (forwarded to the tab owner).

Referenced by MainWindow::MainWindow().

◆ unbind()


The documentation for this class was generated from the following files: