te::qt::af::MenuBarModel Class Reference

Defines a model, based on a QMenuBar, to present all system buttons as a table. More...

#include <MenuBarModel.h>

Inheritance diagram for te::qt::af::MenuBarModel:
QAbstractTableModel

Signals

void updateAction (QAction *, const bool &)
 

Public Member Functions

int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
 MenuBarModel (QMenuBar *mnuBar, QObject *parent=0)
 Constructor. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
void setMenuBar (QMenuBar *mnuBar)
 Sets the menu bar to be used in the model. More...
 
void updateActionsState (const QList< QAction * > &acts)
 Check the actions contained in acts. More...
 
 ~MenuBarModel ()
 Destructor. More...
 

Protected Attributes

std::vector< QAction * > m_actions
 System buttons. More...
 
std::vector< boolm_actionsActivation
 State of each system button. (True insert, False do nothing). More...
 

Detailed Description

Defines a model, based on a QMenuBar, to present all system buttons as a table.

Definition at line 50 of file MenuBarModel.h.

Constructor & Destructor Documentation

te::qt::af::MenuBarModel::MenuBarModel ( QMenuBar *  mnuBar,
QObject parent = 0 
)

Constructor.

Parameters
mnuBarThe menu bar to be used.
parentParent object.

Definition at line 19 of file MenuBarModel.cpp.

References setMenuBar(), and ~MenuBarModel().

te::qt::af::MenuBarModel::~MenuBarModel ( )
default

Destructor.

Referenced by MenuBarModel().

Member Function Documentation

int te::qt::af::MenuBarModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

Definition at line 74 of file MenuBarModel.cpp.

QVariant te::qt::af::MenuBarModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

Definition at line 33 of file MenuBarModel.cpp.

References m_actions, and m_actionsActivation.

Qt::ItemFlags te::qt::af::MenuBarModel::flags ( const QModelIndex &  index) const
virtual

Definition at line 27 of file MenuBarModel.cpp.

QVariant te::qt::af::MenuBarModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

Definition at line 67 of file MenuBarModel.cpp.

int te::qt::af::MenuBarModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

Definition at line 79 of file MenuBarModel.cpp.

References m_actions.

bool te::qt::af::MenuBarModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

Definition at line 84 of file MenuBarModel.cpp.

References m_actions, m_actionsActivation, and updateAction().

void te::qt::af::MenuBarModel::setMenuBar ( QMenuBar *  mnuBar)

Sets the menu bar to be used in the model.

Definition at line 124 of file MenuBarModel.cpp.

References GetActions(), m_actions, m_actionsActivation, and reset().

Referenced by MenuBarModel().

void te::qt::af::MenuBarModel::updateAction ( QAction *  ,
const bool  
)
signal

Referenced by setData().

void te::qt::af::MenuBarModel::updateActionsState ( const QList< QAction * > &  acts)

Check the actions contained in acts.

Parameters
actsList of the actions.

Definition at line 102 of file MenuBarModel.cpp.

References m_actions, m_actionsActivation, and reset().

Member Data Documentation

std::vector<QAction*> te::qt::af::MenuBarModel::m_actions
protected

System buttons.

Definition at line 100 of file MenuBarModel.h.

Referenced by data(), rowCount(), setData(), setMenuBar(), and updateActionsState().

std::vector<bool> te::qt::af::MenuBarModel::m_actionsActivation
protected

State of each system button. (True insert, False do nothing).

Definition at line 101 of file MenuBarModel.h.

Referenced by data(), setData(), setMenuBar(), and updateActionsState().


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