wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
MainWindowUI.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
11#include "App/UI/ICDropZone.h"
12#include "App/UI/TrashButton.h"
13
14// Specific Qt includes instead of monolithic QtWidgets
15#include <QMainWindow>
16#include <QAction>
17#include <QWidget>
18#include <QGridLayout>
19#include <QVBoxLayout>
20#include <QHBoxLayout>
21#include <QSplitter>
22#include <QTabWidget>
23#include <QScrollArea>
24#include <QSpacerItem>
25#include <QPushButton>
26#include <QLabel>
27#include <QLineEdit>
28#include <QToolBar>
29#include <QStatusBar>
30#include <QMenuBar>
31#include <QMenu>
32
34{
35public:
36 // --- Lifecycle ---
37
38 MainWindowUi() = default;
39
40 MainWindowUi(const MainWindowUi&) = delete;
42
43 // --- Setup ---
44
49 void setupUi(QMainWindow *MainWindow);
50
52 void retranslateUi();
53
54 // --- Actions ---
55
56 // File actions
57 QAction *actionNew = nullptr;
58 QAction *actionOpen = nullptr;
59 QAction *actionSave = nullptr;
60 QAction *actionSaveAs = nullptr;
61 QAction *actionReloadFile = nullptr;
62 QAction *actionExit = nullptr;
63
64 // Edit actions
65 QAction *actionCut = nullptr;
66 QAction *actionCopy = nullptr;
67 QAction *actionPaste = nullptr;
68 QAction *actionDuplicate = nullptr;
69 QAction *actionDelete = nullptr;
70 QAction *actionSelectAll = nullptr;
71 QAction *actionClearSelection = nullptr;
72 QAction *actionRename = nullptr;
73 QAction *actionChangeTrigger = nullptr;
74
75 // Transform actions
76 QAction *actionRotateRight = nullptr;
77 QAction *actionRotateLeft = nullptr;
78 QAction *actionFlipHorizontally = nullptr;
79 QAction *actionFlipVertically = nullptr;
80
81 // Align / Distribute actions
82 QAction *actionAlignLeft = nullptr;
83 QAction *actionAlignRight = nullptr;
84 QAction *actionAlignTop = nullptr;
85 QAction *actionAlignBottom = nullptr;
86 QAction *actionAlignHorizontalCenter = nullptr;
87 QAction *actionAlignVerticalCenter = nullptr;
88 QAction *actionDistributeHorizontally = nullptr;
89 QAction *actionDistributeVertically = nullptr;
90
91 // View actions
92 QAction *actionZoomIn = nullptr;
93 QAction *actionZoomOut = nullptr;
94 QAction *actionResetZoom = nullptr;
95 QAction *actionZoomToFit = nullptr;
96 QAction *actionFullscreen = nullptr;
97 QAction *actionFastMode = nullptr;
98 QAction *actionGates = nullptr;
99 QAction *actionWires = nullptr;
100 QAction *actionLabelsUnderIcons = nullptr;
101 QAction *actionICPreview = nullptr;
102 QAction *actionCheckForUpdates = nullptr;
103 QAction *actionShowMinimap = nullptr;
104 QAction *actionLightTheme = nullptr;
105 QAction *actionDarkTheme = nullptr;
106 QAction *actionSystemTheme = nullptr;
107
108 // Simulation actions
109 QAction *actionPlay = nullptr;
110 QAction *actionWaveform = nullptr;
111 QAction *actionMute = nullptr;
112 QAction *actionRestart = nullptr;
113 QAction *actionBackground_Simulation = nullptr;
114
115 // Export actions
116 QAction *actionExportToArduino = nullptr;
117 QAction *actionExportToSystemVerilog = nullptr;
118 QAction *actionExportToPdf = nullptr;
119 QAction *actionExportToImage = nullptr;
120 QAction *actionMakeSelfContained = nullptr;
121
122 // Help / about actions
123 QAction *actionAbout = nullptr;
124 QAction *actionAboutQt = nullptr;
125 QAction *actionAboutThisVersion = nullptr;
126 QAction *actionShortcutsAndTips = nullptr;
128
129 // --- Central Layout ---
130
131 QWidget *centralWidget = nullptr;
132 QGridLayout *gridLayout_8 = nullptr;
133 QSplitter *splitter = nullptr;
134 QTabWidget *tab = nullptr;
135
136 // --- Left Panel (Palette) ---
137
138 QWidget *leftPannel = nullptr;
139 QVBoxLayout *verticalLayout_5 = nullptr;
140 QGridLayout *gridLayout = nullptr;
141 QTabWidget *tabElements = nullptr;
142
143 // I/O tab
144 QWidget *io = nullptr;
145 QGridLayout *gridLayout_2 = nullptr;
146 QScrollArea *scrollAreaInOut = nullptr;
148 QVBoxLayout *verticalLayout = nullptr;
149 QSpacerItem *verticalSpacer_InOut = nullptr;
150
151 // Gates tab
152 QWidget *gates = nullptr;
153 QGridLayout *gridLayout_6 = nullptr;
154 QScrollArea *scrollAreaGates = nullptr;
156 QVBoxLayout *verticalLayout_2 = nullptr;
157 QSpacerItem *verticalSpacer_Gates = nullptr;
158
159 // Combinational tab
160 QWidget *combinational = nullptr;
161 QGridLayout *gridLayout_10 = nullptr;
162 QScrollArea *scrollArea_Combinational = nullptr;
164 QVBoxLayout *verticalLayout_8 = nullptr;
165 QSpacerItem *verticalSpacer_Combinational = nullptr;
166
167 // Memory tab
168 QWidget *memory = nullptr;
169 QGridLayout *gridLayout_5 = nullptr;
170 QScrollArea *scrollAreaMemory = nullptr;
172 QVBoxLayout *verticalLayout_3 = nullptr;
173 QSpacerItem *verticalSpacer_Memory = nullptr;
174
175 // IC tab
176 QWidget *ic = nullptr;
177 QGridLayout *gridLayout_4 = nullptr;
178
179 // File-backed ICs section
180 QLabel *labelFileBasedICs = nullptr;
181 QHBoxLayout *horizontalLayout = nullptr;
182 QPushButton *pushButtonAddIC = nullptr;
184 QPushButton *pushButtonMakeSelfContained = nullptr;
186 QScrollArea *scrollArea_Box = nullptr;
187 QWidget *scrollAreaWidgetContents_IC = nullptr;
188 QVBoxLayout *verticalLayout_4 = nullptr;
189 QSpacerItem *verticalSpacer_IC = nullptr;
190
191 // Embedded ICs section
192 QLabel *labelEmbeddedICs = nullptr;
193 QHBoxLayout *horizontalLayoutEmbeddedIC = nullptr;
194 QPushButton *pushButtonAddEmbeddedIC = nullptr;
197 QScrollArea *scrollAreaEmbeddedIC = nullptr;
199 QVBoxLayout *verticalLayout_EmbeddedIC = nullptr;
200 QSpacerItem *verticalSpacer_EmbeddedIC = nullptr;
201
202 // Misc tab
203 QWidget *misc = nullptr;
204 QGridLayout *gridLayout_3 = nullptr;
205 QScrollArea *scrollArea_Misc = nullptr;
207 QVBoxLayout *verticalLayout_6 = nullptr;
208 QSpacerItem *verticalSpacer_Misc = nullptr;
209
210 // Search tab
211 QWidget *search = nullptr;
212 QGridLayout *gridLayout_9 = nullptr;
213 QScrollArea *scrollArea_Search = nullptr;
215 QVBoxLayout *verticalLayout_7 = nullptr;
216 QSpacerItem *verticalSpacer_Search = nullptr;
217
218 // Search bar
219 QLabel *label = nullptr;
220 QLineEdit *lineEditSearch = nullptr;
221
222 // --- Element Editor Panel ---
223
225
226 // --- Toolbars & Status ---
227
228 QToolBar *mainToolBar = nullptr;
229 QStatusBar *statusBar = nullptr;
230
231 // --- Menu Bar & Menus ---
232
233 QMenuBar *menuBar = nullptr;
234 QMenu *menuFile = nullptr;
235 QMenu *menuRecentFiles = nullptr;
236 QMenu *menuEdit = nullptr;
237 QMenu *menuView = nullptr;
238 QMenu *menuTheme = nullptr;
239 QMenu *menuLanguage = nullptr;
240 QMenu *menuSimulation = nullptr;
241 QMenu *menuExamples = nullptr;
242 QMenu *menuLearn = nullptr;
243 QMenu *menuExercises = nullptr;
244 QMenu *menuTours = nullptr;
245 QMenu *menuHelp = nullptr;
246
247};
ElementEditor widget for inspecting and modifying selected circuit element properties.
ICDropZone: drop target widget for cross-section IC palette drops.
TrashButton: a push-button that accepts drag-and-drop of IC files for deletion.
Widget for inspecting and editing the properties of selected circuit elements.
Drop zone widget that accepts opposite-type IC label drops.
Definition ICDropZone.h:23
QHBoxLayout * horizontalLayout
TrashButton * pushButtonRemoveIC
QScrollArea * scrollAreaGates
QGridLayout * gridLayout_4
QAction * actionMute
QAction * actionAlignTop
QAction * actionRename
QSpacerItem * verticalSpacer_IC
QSpacerItem * verticalSpacer_EmbeddedIC
void retranslateUi()
Updates all translatable strings in the window.
QAction * actionRestart
QGridLayout * gridLayout_3
QAction * actionDuplicate
QWidget * search
QAction * actionDistributeVertically
QAction * actionShortcutsAndTips
QAction * actionSave
QGridLayout * gridLayout
QAction * actionFullscreen
QToolBar * mainToolBar
QAction * actionWires
QMenu * menuView
QSpacerItem * verticalSpacer_Combinational
QAction * actionResetZoom
QScrollArea * scrollAreaMemory
QWidget * gates
QMenu * menuLearn
QScrollArea * scrollAreaEmbeddedIC
MainWindowUi(const MainWindowUi &)=delete
QAction * actionDistributeHorizontally
QScrollArea * scrollArea_Search
QWidget * scrollAreaWidgetContents_EmbeddedIC
QAction * actionChangeTrigger
QMenuBar * menuBar
TrashButton * pushButtonRemoveEmbeddedIC
QLabel * labelEmbeddedICs
QAction * actionClearSelection
QMenu * menuEdit
QWidget * misc
QMenu * menuExercises
QAction * actionFlipVertically
QAction * actionGates
QAction * actionMakeSelfContained
QWidget * memory
QAction * actionAboutQt
QVBoxLayout * verticalLayout_3
QAction * actionOpen
QWidget * scrollAreaWidgetContents_Memory
QAction * actionZoomToFit
QWidget * scrollAreaWidgetContents_IC
QGridLayout * gridLayout_2
QMenu * menuHelp
QAction * actionICPreview
QGridLayout * gridLayout_5
QSpacerItem * verticalSpacer_Search
QAction * actionFlipHorizontally
QGridLayout * gridLayout_8
MainWindowUi & operator=(const MainWindowUi &)=delete
QGridLayout * gridLayout_10
QAction * actionAboutThisVersion
QWidget * scrollAreaWidgetContents_Search
QMenu * menuRecentFiles
QMenu * menuSimulation
QAction * actionPlay
QSpacerItem * verticalSpacer_Gates
QAction * actionReloadFile
QScrollArea * scrollArea_Combinational
QAction * actionAlignRight
QAction * actionLabelsUnderIcons
QAction * actionAlignHorizontalCenter
QSpacerItem * verticalSpacer_InOut
QAction * actionAbout
QLabel * labelFileBasedICs
QAction * actionCheckForUpdates
QAction * actionWaveform
QAction * actionExportToSystemVerilog
QSpacerItem * verticalSpacer_Misc
QScrollArea * scrollArea_Box
QMenu * menuTheme
QVBoxLayout * verticalLayout_5
QAction * actionAlignLeft
QAction * actionCut
QAction * actionRotateLeft
QPushButton * pushButtonAddEmbeddedIC
QAction * actionLightTheme
QScrollArea * scrollArea_Misc
QAction * actionExportToImage
MainWindowUi()=default
QGridLayout * gridLayout_9
QSpacerItem * verticalSpacer_Memory
QTabWidget * tabElements
QAction * actionReportTranslationError
QAction * actionDarkTheme
QWidget * scrollAreaWidgetContents_Gates
QVBoxLayout * verticalLayout_7
QAction * actionSelectAll
QScrollArea * scrollAreaInOut
QGridLayout * gridLayout_6
QStatusBar * statusBar
void setupUi(QMainWindow *MainWindow)
Creates and lays out all child widgets inside MainWindow.
QAction * actionDelete
QAction * actionPaste
QAction * actionRotateRight
QVBoxLayout * verticalLayout
ICDropZone * dropZoneFileBased
QSplitter * splitter
ElementEditor * elementEditor
ICDropZone * dropZoneEmbedded
QVBoxLayout * verticalLayout_6
QHBoxLayout * horizontalLayoutEmbeddedIC
QTabWidget * tab
QPushButton * pushButtonAddIC
QAction * actionBackground_Simulation
QWidget * scrollAreaWidgetContents_InOut
QLabel * label
QVBoxLayout * verticalLayout_4
QMenu * menuTours
QWidget * scrollAreaWidgetContents_Misc
QPushButton * pushButtonMakeSelfContained
QAction * actionAlignBottom
QWidget * leftPannel
QAction * actionNew
QAction * actionAlignVerticalCenter
QWidget * centralWidget
QAction * actionFastMode
QAction * actionExportToArduino
QWidget * scrollAreaWidgetContents_Combinational
QAction * actionZoomIn
QWidget * ic
QMenu * menuLanguage
QWidget * io
QAction * actionExportToPdf
QMenu * menuFile
QAction * actionShowMinimap
QLineEdit * lineEditSearch
QVBoxLayout * verticalLayout_8
QAction * actionCopy
QWidget * combinational
QVBoxLayout * verticalLayout_EmbeddedIC
QAction * actionSaveAs
QAction * actionZoomOut
QMenu * menuExamples
QAction * actionSystemTheme
QAction * actionExit
QVBoxLayout * verticalLayout_2
The top-level application window hosting the tab bar, menus, element palette, and editor.
Definition MainWindow.h:47
Push-button that accepts IC file drag-and-drop to trigger IC removal.
Definition TrashButton.h:20