Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
TreeModel Class Reference

#include </tmp/quassel/src/client/treemodel.h>

Inheritance diagram for TreeModel:
Collaboration diagram for TreeModel:

Classes

struct  ChildStatus

Public Types

enum  myRoles { SortRole = Qt::UserRole, UserRole }

Public Member Functions

 TreeModel (const QList< QVariant > &, QObject *parent=0)
virtual ~TreeModel ()
virtual QVariant data (const QModelIndex &index, int role) const
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
virtual Qt::ItemFlags flags (const QModelIndex &index) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex indexByItem (AbstractTreeItem *item) const
QModelIndex parent (const QModelIndex &index) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
virtual void clear ()

Protected Attributes

AbstractTreeItemrootItem

Private Slots

void itemDataChanged (int column=-1)
void beginAppendChilds (int firstRow, int lastRow)
void endAppendChilds ()
void beginRemoveChilds (int firstRow, int lastRow)
void endRemoveChilds ()
void debug_rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
void debug_rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
void debug_rowsInserted (const QModelIndex &parent, int start, int end)
void debug_rowsRemoved (const QModelIndex &parent, int start, int end)
void debug_dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)

Private Member Functions

void connectItem (AbstractTreeItem *item)

Private Attributes

ChildStatus _childStatus
int _aboutToRemoveOrInsert

Detailed Description

Definition at line 150 of file treemodel.h.

Member Enumeration Documentation

enum myRoles
Enumerator:
SortRole 
UserRole 

Definition at line 155 of file treemodel.h.

Constructor & Destructor Documentation

TreeModel ( const QList< QVariant > &  data,
QObject *  parent = 0 
)
~TreeModel ( )
virtual

Definition at line 362 of file treemodel.cpp.

References rootItem.

Member Function Documentation

QVariant data ( const QModelIndex &  index,
int  role 
) const
virtual
bool setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

Definition at line 462 of file treemodel.cpp.

References AbstractTreeItem::setData().

Referenced by Client::bufferRenamed().

Qt::ItemFlags flags ( const QModelIndex &  index) const
virtual

Definition at line 472 of file treemodel.cpp.

References AbstractTreeItem::flags(), and rootItem.

QVariant headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

Definition at line 484 of file treemodel.cpp.

References AbstractTreeItem::data(), and rootItem.

QModelIndex index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

Definition at line 368 of file treemodel.cpp.

References AbstractTreeItem::child(), columnCount(), rootItem, and rowCount().

Referenced by NetworkModel::mimeData().

QModelIndex parent ( const QModelIndex &  index) const
int rowCount ( const QModelIndex &  parent = QModelIndex()) const
int columnCount ( const QModelIndex &  parent = QModelIndex()) const

Definition at line 434 of file treemodel.cpp.

References AbstractTreeItem::columnCount(), and rootItem.

Referenced by index().

void clear ( )
virtual

Definition at line 616 of file treemodel.cpp.

References AbstractTreeItem::removeAllChilds(), and rootItem.

Referenced by Client::setDisconnectedFromCore().

void itemDataChanged ( int  column = -1)
privateslot

Definition at line 493 of file treemodel.cpp.

References AbstractTreeItem::columnCount(), rootItem, and AbstractTreeItem::row().

Referenced by connectItem().

void beginAppendChilds ( int  firstRow,
int  lastRow 
)
privateslot

Definition at line 531 of file treemodel.cpp.

References _aboutToRemoveOrInsert, _childStatus, indexByItem(), parent(), and rowCount().

Referenced by connectItem().

void beginRemoveChilds ( int  firstRow,
int  lastRow 
)
privateslot
void connectItem ( AbstractTreeItem item)
private
void debug_rowsAboutToBeInserted ( const QModelIndex &  parent,
int  start,
int  end 
)
privateslot

Definition at line 622 of file treemodel.cpp.

References rowCount().

Referenced by TreeModel().

void debug_rowsAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
privateslot

Definition at line 628 of file treemodel.cpp.

References AbstractTreeItem::child(), AbstractTreeItem::data(), rootItem, and rowCount().

Referenced by TreeModel().

void debug_rowsInserted ( const QModelIndex &  parent,
int  start,
int  end 
)
privateslot

Definition at line 645 of file treemodel.cpp.

References AbstractTreeItem::child(), AbstractTreeItem::data(), rootItem, and rowCount().

Referenced by TreeModel().

void debug_rowsRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
privateslot

Definition at line 662 of file treemodel.cpp.

References rowCount().

Referenced by TreeModel().

void debug_dataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
privateslot

Definition at line 668 of file treemodel.cpp.

References data().

Referenced by TreeModel().

Member Data Documentation

ChildStatus _childStatus
private
int _aboutToRemoveOrInsert
private

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