QElectroTech  0.8-dev
Public Member Functions | Private Attributes | List of all members
ModelHeaderDataCommand Class Reference

The ModelHeaderDataCommand class Change the data of a header. More...

#include <itemmodelcommand.h>

Inherits QUndoCommand.

Collaboration diagram for ModelHeaderDataCommand:
Collaboration graph

Public Member Functions

 ModelHeaderDataCommand (QAbstractItemModel *model, QUndoCommand *parent=nullptr)
 ModelHeaderDataCommand::ModelHeaderDataCommand. More...
 
void setData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::DisplayRole)
 ModelHeaderDataCommand::setData See QAbstractItemModel::setHeaderData. More...
 
virtual void redo () override
 ModelHeaderDataCommand::redo Reimplemented from QUndoCommand. More...
 
virtual void undo () override
 ModelHeaderDataCommand::undo Reimplemented from QUndoCommand. More...
 

Private Attributes

QPointer< QAbstractItemModel > m_model
 
Qt::Orientation m_orientation
 
QVariant m_old_value
 
QVariant m_new_value
 
int m_section
 
int m_role
 

Detailed Description

The ModelHeaderDataCommand class Change the data of a header.

Constructor & Destructor Documentation

◆ ModelHeaderDataCommand()

ModelHeaderDataCommand::ModelHeaderDataCommand ( QAbstractItemModel *  model,
QUndoCommand *  parent = nullptr 
)

Member Function Documentation

◆ redo()

void ModelHeaderDataCommand::redo ( )
overridevirtual

ModelHeaderDataCommand::redo Reimplemented from QUndoCommand.

◆ setData()

void ModelHeaderDataCommand::setData ( int  section,
Qt::Orientation  orientation,
const QVariant &  value,
int  role = Qt::DisplayRole 
)

ModelHeaderDataCommand::setData See QAbstractItemModel::setHeaderData.

Parameters
section
orientation
value
role

◆ undo()

void ModelHeaderDataCommand::undo ( )
overridevirtual

ModelHeaderDataCommand::undo Reimplemented from QUndoCommand.

Member Data Documentation

◆ m_model

QPointer<QAbstractItemModel> ModelHeaderDataCommand::m_model
private

◆ m_new_value

QVariant ModelHeaderDataCommand::m_new_value
private

◆ m_old_value

QVariant ModelHeaderDataCommand::m_old_value
private

◆ m_orientation

Qt::Orientation ModelHeaderDataCommand::m_orientation
private

◆ m_role

int ModelHeaderDataCommand::m_role
private

◆ m_section

int ModelHeaderDataCommand::m_section
private

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