Skip to content

Commit

Permalink
Undostack: Introduce undostack
Browse files Browse the repository at this point in the history
Right now we're using QUndoStack which is from Qt library, although it
has limited usage which we want to expand since we want to handle errors
in a proper way without any hacks regarding QUndoStack, so these series
of patches will introduce customly made Undostack, as well as Command
class which will replace QUndoCommand/QUndoStack classes.
  • Loading branch information
tetektoza committed Nov 23, 2023
1 parent 817c4b9 commit fea833b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ set(PROJECT_SOURCES
source/openasdialog.cpp
source/palettewidget.cpp
source/settingsdialog.cpp
source/undostack.cpp
source/undostack.h
source/command.cpp
source/command.h
)

if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
Expand Down
2 changes: 2 additions & 0 deletions source/command.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "command.h"

6 changes: 6 additions & 0 deletions source/command.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once


class Command {

};
1 change: 1 addition & 0 deletions source/undostack.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "undostack.h"
8 changes: 8 additions & 0 deletions source/undostack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include "command.h"

class UndoStack {
private:
std::vector<Command> cmds;
};

0 comments on commit fea833b

Please sign in to comment.