Qt Model Utilities  2.0.3
A set of utilities for the model/view framework of Qt
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
RootIndexProxyModel Class Reference

This proxy model will display only the portion of a tree model with the common ancestor rootIndex. More...

Inheritance diagram for RootIndexProxyModel:

Signals

void rootIndexChanged ()
 

Public Member Functions

 RootIndexProxyModel (QObject *parent=Q_NULLPTR)
 
 ~RootIndexProxyModel ()
 
bool canFetchMore (const QModelIndex &parent) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
void fetchMore (const QModelIndex &parent) override
 
bool hasChildren (const QModelIndex &parent) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
bool insertColumns (int column, int count, const QModelIndex &parent=QModelIndex()) override
 
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
QModelIndex mapFromSource (const QModelIndex &sourceIndex) const override
 
QModelIndex mapToSource (const QModelIndex &proxyIndex) const override
 
bool moveColumns (const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild) override
 
bool moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
 
bool removeColumns (int column, int count, const QModelIndex &parent=QModelIndex()) override
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
QModelIndex rootIndex () const
 Getter for rootIndex property. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
void setRootIndex (const QModelIndex &root)
 Setter for rootIndex property. More...
 
void setSourceModel (QAbstractItemModel *sourceModel) override
 

Protected Member Functions

 RootIndexProxyModel (RootIndexProxyModelPrivate &dptr, QObject *parent)
 

Properties

QModelIndex rootIndex
 This property holds the root index of the model. More...
 

Detailed Description

This proxy model will display only the portion of a tree model with the common ancestor rootIndex.

The functionality is similar to QAbstractItemView::setRootIndex but on the model side

Constructor & Destructor Documentation

◆ RootIndexProxyModel()

RootIndexProxyModel::RootIndexProxyModel ( QObject *  parent = Q_NULLPTR)
explicit

Constructs a new proxy model with the given parent.

◆ ~RootIndexProxyModel()

RootIndexProxyModel::~RootIndexProxyModel ( )

Destructor

Member Function Documentation

◆ canFetchMore()

bool RootIndexProxyModel::canFetchMore ( const QModelIndex &  parent) const
override

Reimplemented from base class

◆ columnCount()

int RootIndexProxyModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Reimplemented from base class

◆ dropMimeData()

bool RootIndexProxyModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
override

Reimplemented from base class

◆ fetchMore()

void RootIndexProxyModel::fetchMore ( const QModelIndex &  parent)
override

Reimplemented from base class

◆ hasChildren()

bool RootIndexProxyModel::hasChildren ( const QModelIndex &  parent) const
override

Reimplemented from base class

◆ index()

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

Reimplemented from base class

◆ insertColumns()

bool RootIndexProxyModel::insertColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Reimplemented from base class

◆ insertRows()

bool RootIndexProxyModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Reimplemented from base class

◆ mapFromSource()

QModelIndex RootIndexProxyModel::mapFromSource ( const QModelIndex &  sourceIndex) const
override

Reimplemented from base class

◆ mapToSource()

QModelIndex RootIndexProxyModel::mapToSource ( const QModelIndex &  proxyIndex) const
override

Reimplemented from base class

◆ moveColumns()

bool RootIndexProxyModel::moveColumns ( const QModelIndex &  sourceParent,
int  sourceColumn,
int  count,
const QModelIndex &  destinationParent,
int  destinationChild 
)
override

Reimplemented from base class

◆ moveRows()

bool RootIndexProxyModel::moveRows ( const QModelIndex &  sourceParent,
int  sourceRow,
int  count,
const QModelIndex &  destinationParent,
int  destinationChild 
)
override

Reimplemented from base class

◆ removeColumns()

bool RootIndexProxyModel::removeColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Reimplemented from base class

◆ removeRows()

bool RootIndexProxyModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Reimplemented from base class

◆ rootIndex()

QModelIndex RootIndexProxyModel::rootIndex ( ) const

Getter for rootIndex property.

◆ rowCount()

int RootIndexProxyModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Reimplemented from base class

◆ setRootIndex()

void RootIndexProxyModel::setRootIndex ( const QModelIndex &  root)

Setter for rootIndex property.

◆ setSourceModel()

void RootIndexProxyModel::setSourceModel ( QAbstractItemModel *  sourceModel)
override

Reimplemented from base class

Property Documentation

◆ rootIndex

RootIndexProxyModel::rootIndex
readwrite

This property holds the root index of the model.

Access functions: rootIndex(), setRootIndex()
Notifier signal: rootIndexChanged()

The root index is an index of the source model used as root by all elements of the proxy model