• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KIdentityProxyModel Class Reference

#include <kidentityproxymodel.h>

Inheritance diagram for KIdentityProxyModel:
Inheritance graph
[legend]

Public Member Functions

 KIdentityProxyModel (QObject *parent=0)
 
virtual ~KIdentityProxyModel ()
 
virtual bool canFetchMore (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
virtual void fetchMore (const QModelIndex &parent)
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
bool insertColumns (int column, int count, const QModelIndex &parent=QModelIndex())
 
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
QModelIndex mapFromSource (const QModelIndex &sourceIndex) const
 
QItemSelection mapSelectionFromSource (const QItemSelection &selection) const
 
QItemSelection mapSelectionToSource (const QItemSelection &selection) const
 
QModelIndex mapToSource (const QModelIndex &proxyIndex) const
 
QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
QModelIndex parent (const QModelIndex &child) const
 
bool removeColumns (int column, int count, const QModelIndex &parent=QModelIndex())
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
void setSourceModel (QAbstractItemModel *sourceModel)
 
virtual Qt::DropActions supportedDropActions () const
 
- Public Member Functions inherited from QAbstractProxyModel
 QAbstractProxyModel (QObject *parent)
 
 ~QAbstractProxyModel ()
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
virtual QVariant data (const QModelIndex &proxyIndex, int role) const
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
virtual bool hasChildren (const QModelIndex &parent) const
 
virtual QMap< int, QVariant > itemData (const QModelIndex &proxyIndex) const
 
virtual QModelIndex mapFromSource (const QModelIndex &sourceIndex) const =0
 
virtual QModelIndex mapToSource (const QModelIndex &proxyIndex) const =0
 
virtual void revert ()
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
virtual void sort (int column, Qt::SortOrder order)
 
QAbstractItemModel * sourceModel () const
 
virtual QSize span (const QModelIndex &index) const
 
virtual bool submit ()
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent)
 
virtual  ~QAbstractItemModel ()
 
virtual int columnCount (const QModelIndex &parent) const =0
 
void columnsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void columnsInserted (const QModelIndex &parent, int start, int end)
 
void columnsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsRemoved (const QModelIndex &parent, int start, int end)
 
virtual QVariant data (const QModelIndex &index, int role) const =0
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
bool hasIndex (int row, int column, const QModelIndex &parent) const
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const =0
 
bool insertColumn (int column, const QModelIndex &parent)
 
bool insertRow (int row, const QModelIndex &parent)
 
void layoutAboutToBeChanged ()
 
void layoutChanged ()
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
virtual QModelIndex parent (const QModelIndex &index) const =0
 
bool removeColumn (int column, const QModelIndex &parent)
 
bool removeRow (int row, const QModelIndex &parent)
 
const QHash< int, QByteArray > & roleNames () const
 
virtual int rowCount (const QModelIndex &parent) const =0
 
void rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void rowsInserted (const QModelIndex &parent, int start, int end)
 
void rowsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsRemoved (const QModelIndex &parent, int start, int end)
 
void setSupportedDragActions (QFlags< Qt::DropAction > actions)
 
QModelIndex sibling (int row, int column, const QModelIndex &index) const
 
Qt::DropActions supportedDragActions () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Slots

virtual void resetInternalData ()
 

Protected Member Functions

 KIdentityProxyModel (KIdentityProxyModelPrivate *privateClass, QObject *parent)
 
- Protected Member Functions inherited from QAbstractItemModel
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void beginResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
QModelIndex createIndex (int row, int column, void *ptr) const
 
QModelIndex createIndex (int row, int column, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
QModelIndexList persistentIndexList () const
 
void reset ()
 
void resetInternalData ()
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

KIdentityProxyModelPrivate *const d_ptr
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The KIdentityProxyModel class proxies its source model unmodified.

Since
4.6

KIdentityProxyModel can be used to forward the structure of a source model exactly, with no sorting, filtering or other transformation. This is similar in concept to an identity matrix where A.I = A.

Because it does no sorting or filtering, this class is most suitable to proxy models which transform the data() of the source model. For example, a proxy model could be created to define the font used, or the background colour, or the tooltip etc. This removes the need to implement all data handling in the same class that creates the structure of the model, and can also be used to create re-usable components.

This also provides a way to change the data in the case where a source model is supplied by a third party which can not be modified.

class DateFormatProxyModel : public KIdentityProxyModel
{
// ...
void setDateFormatString(const QString &formatString)
{
m_formatString = formatString;
}
QVariant data(const QModelIndex &index, int role)
{
if (role != Qt::DisplayRole)
return KIdentityProxyModel::data(index, role);
const QDateTime dateTime = sourceModel()->data(SourceClass::DateRole).toDateTime();
return dateTime.toString(m_formatString);
}
private:
QString m_formatString;
};
Since
4.6
Author
Stephen Kelly steph.nosp@m.en@k.nosp@m.dab.c.nosp@m.om

Definition at line 31 of file kidentityproxymodel.h.

Constructor & Destructor Documentation

KIdentityProxyModel::KIdentityProxyModel ( QObject *  parent = 0)
explicit

Constructs an identity model with the given parent.

Definition at line 123 of file kidentityproxymodel.cpp.

KIdentityProxyModel::~KIdentityProxyModel ( )
virtual

Destroys this identity model.

Definition at line 140 of file kidentityproxymodel.cpp.

KIdentityProxyModel::KIdentityProxyModel ( KIdentityProxyModelPrivate *  privateClass,
QObject *  parent 
)
protected

Definition at line 131 of file kidentityproxymodel.cpp.

Member Function Documentation

bool KIdentityProxyModel::canFetchMore ( const QModelIndex &  parent) const
virtual
Reimplemented from superclass.

Reimplemented from QAbstractProxyModel.

Definition at line 148 of file kidentityproxymodel.cpp.

int KIdentityProxyModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

\reimp

Definition at line 159 of file kidentityproxymodel.cpp.

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

\reimp

Reimplemented from QAbstractItemModel.

Definition at line 181 of file kidentityproxymodel.cpp.

void KIdentityProxyModel::fetchMore ( const QModelIndex &  parent)
virtual
Reimplemented from superclass.

Reimplemented from QAbstractProxyModel.

Definition at line 170 of file kidentityproxymodel.cpp.

QVariant KIdentityProxyModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
virtual

\reimp

Since
4.14.7

Reimplemented from QAbstractProxyModel.

Definition at line 193 of file kidentityproxymodel.cpp.

QModelIndex KIdentityProxyModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
Reimplemented from superclass.

Definition at line 203 of file kidentityproxymodel.cpp.

bool KIdentityProxyModel::insertColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual
Reimplemented from superclass.

Reimplemented from QAbstractItemModel.

Definition at line 216 of file kidentityproxymodel.cpp.

bool KIdentityProxyModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual
Reimplemented from superclass.

Reimplemented from QAbstractItemModel.

Definition at line 227 of file kidentityproxymodel.cpp.

QModelIndex KIdentityProxyModel::mapFromSource ( const QModelIndex &  sourceIndex) const
Reimplemented from superclass.

Definition at line 238 of file kidentityproxymodel.cpp.

QItemSelection KIdentityProxyModel::mapSelectionFromSource ( const QItemSelection &  selection) const
virtual
Reimplemented from superclass.

Reimplemented from QAbstractProxyModel.

Definition at line 250 of file kidentityproxymodel.cpp.

QItemSelection KIdentityProxyModel::mapSelectionToSource ( const QItemSelection &  selection) const
virtual
Reimplemented from superclass.

Reimplemented from QAbstractProxyModel.

Definition at line 271 of file kidentityproxymodel.cpp.

QModelIndex KIdentityProxyModel::mapToSource ( const QModelIndex &  proxyIndex) const
Reimplemented from superclass.

Definition at line 307 of file kidentityproxymodel.cpp.

QModelIndexList KIdentityProxyModel::match ( const QModelIndex &  start,
int  role,
const QVariant &  value,
int  hits = 1,
Qt::MatchFlags  flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap) 
) const
Reimplemented from superclass.

Definition at line 318 of file kidentityproxymodel.cpp.

QMimeData * KIdentityProxyModel::mimeData ( const QModelIndexList &  indexes) const
virtual

Reimplemented from QAbstractProxyModel.

Definition at line 344 of file kidentityproxymodel.cpp.

QStringList KIdentityProxyModel::mimeTypes ( ) const
virtual
Reimplemented from superclass.

Reimplemented from QAbstractProxyModel.

Definition at line 336 of file kidentityproxymodel.cpp.

QModelIndex KIdentityProxyModel::parent ( const QModelIndex &  child) const

\reimp

Definition at line 360 of file kidentityproxymodel.cpp.

bool KIdentityProxyModel::removeColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual
Reimplemented from superclass.

Reimplemented from QAbstractItemModel.

Definition at line 374 of file kidentityproxymodel.cpp.

bool KIdentityProxyModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual
Reimplemented from superclass.

Reimplemented from QAbstractItemModel.

Definition at line 386 of file kidentityproxymodel.cpp.

void KIdentityProxyModel::resetInternalData ( )
protectedvirtualslot

This slot is automatically invoked when the model is reset. It can be used to clear any data internal to the proxy at the appropriate time.

See also
QAbstractItemModel::internalDataReset()

Definition at line 763 of file kidentityproxymodel.cpp.

int KIdentityProxyModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
Reimplemented from superclass.

Definition at line 398 of file kidentityproxymodel.cpp.

void KIdentityProxyModel::setSourceModel ( QAbstractItemModel *  sourceModel)
virtual
Reimplemented from superclass.

Reimplemented from QAbstractProxyModel.

Definition at line 409 of file kidentityproxymodel.cpp.

Qt::DropActions KIdentityProxyModel::supportedDropActions ( ) const
virtual

Reimplemented from QAbstractProxyModel.

Definition at line 513 of file kidentityproxymodel.cpp.

Member Data Documentation

KIdentityProxyModelPrivate* const KIdentityProxyModel::d_ptr
protected

Definition at line 65 of file kidentityproxymodel.h.


The documentation for this class was generated from the following files:
  • kidentityproxymodel.h
  • kidentityproxymodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal