wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
SceneUiBinder.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <QByteArray>
11#include <QObject>
12#include <QString>
13
14class ElementPalette;
15class ICPreviewPopup;
16class MainWindowUi;
17class QLabel;
18class QShortcut;
19class QWidget;
20class WorkSpace;
21
34class SceneUiBinder : public QObject
35{
36 Q_OBJECT
37
38 // Test-only seam: the private guard methods below are only reachable through their
39 // signal connections once bind() has run, which always sets m_bound first -- calling
40 // them directly is the only way to exercise their "not bound yet" guards.
41 friend class TestSceneUiBinder;
42
43public:
49 SceneUiBinder(MainWindowUi *ui, ElementPalette *palette, ICPreviewPopup *previewPopup, QWidget *shortcutParent, QObject *parent = nullptr);
50
52 void bind(WorkSpace *tab);
53
55 void unbind();
56
57signals:
59 void openICRequested(const QString &blobName, int icElementId, const QByteArray &blob);
61 void loadFileRequested(const QString &filePath);
62
63private:
64 void addUndoRedoMenu();
65 void removeUndoRedoMenu();
66 void syncZoomActions();
69 void updateStatusInfo();
70
71 MainWindowUi *m_ui;
72 ElementPalette *m_palette;
73 ICPreviewPopup *m_previewPopup;
74 QLabel *m_statusInfo = nullptr;
75 WorkSpace *m_bound = nullptr;
76
77 // Scene-property navigation shortcuts ( [ ] { } < > ), re-targeted to the active scene.
78 QShortcut *m_prevMainPropShortcut;
79 QShortcut *m_nextMainPropShortcut;
80 QShortcut *m_prevSecndPropShortcut;
81 QShortcut *m_nextSecndPropShortcut;
82 QShortcut *m_changePrevElmShortcut;
83 QShortcut *m_changeNextElmShortcut;
84};
Controller for the left-panel element palette, IC list, and search tab.
Frameless tooltip-like widget showing a rendered preview of an IC's sub-circuit.
SceneUiBinder(MainWindowUi *ui, ElementPalette *palette, ICPreviewPopup *previewPopup, QWidget *shortcutParent, QObject *parent=nullptr)
friend class TestSceneUiBinder
void bind(WorkSpace *tab)
Connects tab's scene/view/simulation to the chrome and syncs action state.
void unbind()
Tears down the connections established by bind() for the currently bound tab.
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).
A widget containing a complete circuit editing environment.
Definition Workspace.h:33