comparison include/gui/window.h @ 114:ab191e28e69d

*: add initial torrent stuff WOAH! these checkboxes are a pain in my fucking ass
author Paper <mrpapersonic@gmail.com>
date Tue, 07 Nov 2023 08:03:42 -0500
parents 80f49f623d30
children c8375765f0fc
comparison
equal deleted inserted replaced
113:32afe0e940bf 114:ab191e28e69d
1 #ifndef __window_h 1 #ifndef __window_h
2 #define __window_h 2 #define __window_h
3 #include "core/config.h" 3 #include "core/config.h"
4 #include <QMainWindow> 4 #include <QMainWindow>
5 #include <memory>
5 6
6 class QWidget; 7 /* *could* be forward-declared, but this causes
7 class QStackedWidget; 8 any file that #includes this to have to #include
8 class QCloseEvent; 9 these as well due to unique_ptr */
9 class SideBar; 10 #include <QWidget>
11 #include <QStackedWidget>
12 #include <QCloseEvent>
13 #include "gui/widgets/sidebar.h"
10 14
11 class MainWindow final : public QMainWindow { 15 class MainWindow final : public QMainWindow {
12 Q_OBJECT 16 Q_OBJECT
13 17
14 public: 18 public:
21 void changeEvent(QEvent* event) override; 25 void changeEvent(QEvent* event) override;
22 void showEvent(QShowEvent* event) override; 26 void showEvent(QShowEvent* event) override;
23 void closeEvent(QCloseEvent* event) override; 27 void closeEvent(QCloseEvent* event) override;
24 28
25 private: 29 private:
26 QWidget* main_widget = nullptr; 30 std::unique_ptr<QWidget> main_widget = nullptr;
27 QStackedWidget* stack = nullptr; 31 std::unique_ptr<QStackedWidget> stack = nullptr;
28 SideBar* sidebar = nullptr; 32 std::unique_ptr<SideBar> sidebar = nullptr;
29 }; 33 };
30 34
31 #endif // __window_h 35 #endif // __window_h