Pointer cleanup (#242)

- Made greater use of smart pointers, eliminating many instances of manual memory management
- Do not use pointers at all for many non-polymorphic classes
- Assorted other code cleanup
This commit is contained in:
Jaye Evins
2025-10-31 16:11:28 -04:00
committed by GitHub
parent fd10d88be5
commit 8c8e447336
159 changed files with 3364 additions and 4045 deletions
+15 -5
View File
@@ -21,6 +21,9 @@
#ifndef MainWindow_h
#define MainWindow_h
#include "UndoRedoModel.h"
#include <model/Model.h>
#include <QAction>
@@ -35,6 +38,8 @@
#include <QToolBar>
#include <QToolButton>
#include <memory>
namespace glabels
{
@@ -46,7 +51,6 @@ namespace glabels
class PrintView;
class PropertiesView;
class StartupView;
class UndoRedoModel;
class VariablesView;
@@ -63,7 +67,7 @@ namespace glabels
/////////////////////////////////////
public:
MainWindow();
~MainWindow() override;
virtual ~MainWindow() = default;
/////////////////////////////////////
@@ -194,8 +198,17 @@ namespace glabels
/////////////////////////////////////
// Private Data
// owned and managed by us
/////////////////////////////////////
private:
std::unique_ptr<model::Model> mModel;
std::unique_ptr<UndoRedoModel> mUndoRedoModel;
/////////////////////////////////////
// Private Data
// owned by QMainWindow
/////////////////////////////////////
QMenu* fileMenu;
QMenu* fileRecentMenu;
QMenu* editMenu;
@@ -219,9 +232,6 @@ namespace glabels
QToolBar* fileToolBar;
QToolBar* editorToolBar;
model::Model* mModel;
UndoRedoModel* mUndoRedoModel;
QToolBar* mContents;
QToolButton* mWelcomeButton;
QToolButton* mEditorButton;