CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1#ifndef MAINWINDOW_H
2#define MAINWINDOW_H
3
4#include <QSettings>
5#include <QtWidgets/QMainWindow>
6#include <memory>
7
9
10class QCloseEvent;
11class QPushButton;
12
13namespace Ui {
14class ToolBar;
15class MainWindow;
16} // namespace Ui
17
18class MainWindow : public QMainWindow {
19 Q_OBJECT
20
21public:
22 enum class Styles { darkStyle, lightStyle };
23
24 explicit MainWindow(QWidget* parent = nullptr);
26
27private:
28 std::unique_ptr<Ui::MainWindow> _ui;
29 std::unique_ptr<Ui::ToolBar> _toolBar;
30 std::unique_ptr<ProjectConfig> _projectConfig;
31 QString _projectFile;
32 QString _projectName;
33 Styles _currentStyle;
34 QSettings _settings;
35 QVector<std::pair<QString, QString>> _recentProjects;
36 QVector<std::pair<QPushButton *, QPushButton *>> _recentProjectsButtons;
37
38 void connectToolbarSignals();
39 void connectMenuSignals();
40 void closeEvent(QCloseEvent* event);
41 void handleLoadAction();
42 void handleAboutAction();
43 void handleSaveAction();
44 void handleSaveAsAction();
45 void addToMdi(QWidget* component);
46 void loadSettings();
47 void saveSettings();
48 void addRecentProject(const QString &name, const QString &path);
49 void refreshRecentProjects();
50 void handleRecentProject(int ndx);
51
52public slots:
53 void handleDock(QWidget* component);
54 void handleWidgetDeletion(QWidget* widget);
55 void handleWidgetShowing(QWidget* widget, bool docked);
56 bool createProjectConfig(const QString& name);
57 bool closeProjectConfig();
58 void switchStyle();
59 void setStyle(Styles style);
60};
61
62#endif // MAINWINDOW_H
Definition mainwindow.h:18
bool createProjectConfig(const QString &name)
Definition mainwindow.cpp:454
void handleWidgetShowing(QWidget *widget, bool docked)
Definition mainwindow.cpp:551
void handleWidgetDeletion(QWidget *widget)
Definition mainwindow.cpp:539
bool closeProjectConfig()
Definition mainwindow.cpp:412
void switchStyle()
Definition mainwindow.cpp:574
Styles
Definition mainwindow.h:22
void handleDock(QWidget *component)
Definition mainwindow.cpp:220
void setStyle(Styles style)
Definition mainwindow.cpp:582
~MainWindow()
Definition mainwindow.cpp:91
Definition canrawsender_p.h:13