FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
qtgui::IndexedSelectionModel Class Reference

Helper that keeps track of selected items in any kind of view (not specific to Qt) More...

#include <qttools/gui/indexed_selection_model.h>

Inheritance diagram for qtgui::IndexedSelectionModel:

Public Slots

virtual void clear ()
 Untoggle all selected items, this will emit selectionCleared() at the end. More...
 
void toggleItem (int id)
 Toggle the item's selection state of index id. More...
 

Signals

void selectionCleared ()
 
void itemToggled (int id, bool on)
 
void selectionChanged ()
 

Public Member Functions

 IndexedSelectionModel (QObject *parent=NULL)
 
const QSet< int > & selectedItems () const
 Indexes of the items being selected in the view. More...
 
virtual bool hasSelection () const
 Is the selection not empty ? More...
 
virtual bool isValidIndex (int id) const
 

Protected Member Functions

void beginClear ()
 
void clearItems ()
 
void endClear ()
 

Detailed Description

Helper that keeps track of selected items in any kind of view (not specific to Qt)

View items are each referenced by an index that the caller must provide.

Constructor & Destructor Documentation

qtgui::IndexedSelectionModel::IndexedSelectionModel ( QObject *  parent = NULL)

Member Function Documentation

void qtgui::IndexedSelectionModel::beginClear ( )
protected
void qtgui::IndexedSelectionModel::clear ( )
virtualslot

Untoggle all selected items, this will emit selectionCleared() at the end.

Signal selectionCleared() is emitted only if hasSelection() returned true.

void qtgui::IndexedSelectionModel::clearItems ( )
protected
void qtgui::IndexedSelectionModel::endClear ( )
protected
bool qtgui::IndexedSelectionModel::hasSelection ( ) const
virtual

Is the selection not empty ?

bool qtgui::IndexedSelectionModel::isValidIndex ( int  id) const
virtual

Is index id valid ?

By default only indexes >= 0 are valid.

void qtgui::IndexedSelectionModel::itemToggled ( int  id,
bool  on 
)
signal
const QSet< int > & qtgui::IndexedSelectionModel::selectedItems ( ) const

Indexes of the items being selected in the view.

void qtgui::IndexedSelectionModel::selectionChanged ( )
signal
void qtgui::IndexedSelectionModel::selectionCleared ( )
signal
void qtgui::IndexedSelectionModel::toggleItem ( int  id)
slot

Toggle the item's selection state of index id.


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