QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
MoveDiagramCommand Class Reference

The MoveDiagramCommand class Undo/redo support for reordering a folio (diagram) within a project's tabs. Wraps ProjectView::setDiagramPosition(), which performs the tab move and the matching (synchronous) project diagram-list reorder in one step. More...

#include <movediagramcommand.h>

Inherits QUndoCommand.

Collaboration diagram for MoveDiagramCommand:
Collaboration graph

Public Member Functions

 MoveDiagramCommand (ProjectView *project_view, Diagram *diagram, int new_position, QUndoCommand *parent=nullptr)
 MoveDiagramCommand::MoveDiagramCommand.
void undo () override
void redo () override

Private Attributes

QPointer< ProjectViewm_project_view
Diagramm_diagram
int m_old_position
int m_new_position

Detailed Description

The MoveDiagramCommand class Undo/redo support for reordering a folio (diagram) within a project's tabs. Wraps ProjectView::setDiagramPosition(), which performs the tab move and the matching (synchronous) project diagram-list reorder in one step.

Constructor & Destructor Documentation

◆ MoveDiagramCommand()

MoveDiagramCommand::MoveDiagramCommand ( ProjectView * project_view,
Diagram * diagram,
int new_position,
QUndoCommand * parent = nullptr )

MoveDiagramCommand::MoveDiagramCommand.

Parameters
project_view: project view the diagram's tab belongs to
diagram: the diagram to move
new_position: target position (may be out of range, e.g. for a x10/x100 move near either end – ProjectView::setDiagramPosition() clamps it the same way the underlying tab bar always has)
parent

Member Function Documentation

◆ redo()

void MoveDiagramCommand::redo ( )
override

◆ undo()

void MoveDiagramCommand::undo ( )
override

Member Data Documentation

◆ m_diagram

Diagram* MoveDiagramCommand::m_diagram
private

◆ m_new_position

int MoveDiagramCommand::m_new_position
private

◆ m_old_position

int MoveDiagramCommand::m_old_position
private

◆ m_project_view

QPointer<ProjectView> MoveDiagramCommand::m_project_view
private

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