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
38public:
43 SceneUiBinder(MainWindowUi *ui, ElementPalette *palette, ICPreviewPopup *previewPopup, QWidget *shortcutParent, QObject *parent = nullptr);
44
46 void bind(WorkSpace *tab);
47
49 void unbind();
50
51signals:
53 void openICRequested(const QString &blobName, int icElementId, const QByteArray &blob);
55 void loadFileRequested(const QString &filePath);
56
57private:
58 void addUndoRedoMenu();
59 void removeUndoRedoMenu();
60 void syncZoomActions();
63 void updateStatusInfo();
64
65 MainWindowUi *m_ui;
66 ElementPalette *m_palette;
67 ICPreviewPopup *m_previewPopup;
68 QLabel *m_statusInfo = nullptr;
69 WorkSpace *m_bound = nullptr;
70
71 // Scene-property navigation shortcuts ( [ ] { } < > ), re-targeted to the active scene.
72 QShortcut *m_prevMainPropShortcut;
73 QShortcut *m_nextMainPropShortcut;
74 QShortcut *m_prevSecndPropShortcut;
75 QShortcut *m_nextSecndPropShortcut;
76 QShortcut *m_changePrevElmShortcut;
77 QShortcut *m_changeNextElmShortcut;
78};
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)
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