|
wiRedPanda
Logic Circuit Simulator
|
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>
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. | |
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.
| SceneUiBinder::SceneUiBinder | ( | MainWindowUi * | ui, |
| ElementPalette * | palette, | ||
| ICPreviewPopup * | previewPopup, | ||
| QWidget * | shortcutParent, | ||
| QObject * | parent = nullptr ) |
| ui | Shared UI (element editor, menus, actions, status bar). |
| palette | Element palette (embedded-IC list reflects the active scene). |
| previewPopup | Shared IC hover-preview popup, driven off the bound scene's IC signals. |
| shortcutParent | Widget that parents the scene-property shortcuts (the window). |
Definition at line 26 of file SceneUiBinder.cpp.
| 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().
| 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().
| 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().
| void SceneUiBinder::unbind | ( | ) |
Tears down the connections established by bind() for the currently bound tab.
Definition at line 219 of file SceneUiBinder.cpp.
References Scene::circuitHasChanged(), Scene::icOpenRequested(), Scene::icPreviewCancelRequested(), Scene::icPreviewHideRequested(), Scene::icPreviewMoved(), Scene::icPreviewRequested(), Scene::openTruthTableRequested(), qCDebug, Scene::showStatusMessageRequested(), Simulation::simulationWarning(), and GraphicsView::zoomChanged().