SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
MapUndoStack Class Reference

An undo/redo stack for map operations with a configurable maximum depth. More...

#include <mapundostack.h>

Inheritance diagram for MapUndoStack:
Collaboration diagram for MapUndoStack:

Signals

void maxUndoCountChanged (int count)
 

Public Member Functions

 MapUndoStack (QObject *parent=nullptr)
 
int maxUndoCount () const
 Returns the maximum number of undoable steps stored (0 = unlimited).
 
void setMaxUndoCount (int count)
 Sets the maximum number of stored undo operations.
 
void loadSettings ()
 Convenience: loads the undo limit from QSettings (key "MapCanvas/undoLimit").
 
void saveSettings () const
 Saves the current undo limit to QSettings.
 

Properties

int maxUndoCount
 

Detailed Description

An undo/redo stack for map operations with a configurable maximum depth.

Extends QUndoStack to expose the undo limit as a Q_PROPERTY so it can be configured in the application settings and bound to UI controls.

The default limit is 50 operations. Set to 0 for unlimited.

Usage:

MapUndoStack *stack = new MapUndoStack(this);
stack->setMaxUndoCount(100);
stack->push(new PanCommand(oldExtent, newExtent, canvas));
stack->undo();
An undo/redo stack for map operations with a configurable maximum depth.
Definition mapundostack.h:117
void setMaxUndoCount(int count)
Sets the maximum number of stored undo operations.
Definition mapundostack.cpp:53

Constructor & Destructor Documentation

◆ MapUndoStack()

MapUndoStack::MapUndoStack ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ loadSettings()

void MapUndoStack::loadSettings ( )

Convenience: loads the undo limit from QSettings (key "MapCanvas/undoLimit").

Here is the call graph for this function:

◆ maxUndoCount()

int MapUndoStack::maxUndoCount ( ) const

Returns the maximum number of undoable steps stored (0 = unlimited).

◆ maxUndoCountChanged

void MapUndoStack::maxUndoCountChanged ( int  count)
signal
Here is the caller graph for this function:

◆ saveSettings()

void MapUndoStack::saveSettings ( ) const

Saves the current undo limit to QSettings.

◆ setMaxUndoCount()

void MapUndoStack::setMaxUndoCount ( int  count)

Sets the maximum number of stored undo operations.

If the current stack depth exceeds the new limit, oldest commands are silently discarded.

Parameters
countMaximum depth; 0 means unlimited.
Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ maxUndoCount

int MapUndoStack::maxUndoCount
readwrite

The documentation for this class was generated from the following files: