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

kdevplatform/project

  • KDevelop
  • ProjectModel
Public Types | Public Member Functions | List of all members
KDevelop::ProjectModel Class Reference

#include <projectmodel.h>

Inheritance diagram for KDevelop::ProjectModel:
Inheritance graph
[legend]

Public Types

enum  Roles { ProjectRole = Qt::UserRole+1, ProjectItemRole, UrlRole, LastRole }
 

Public Member Functions

 ProjectModel (QObject *parent=nullptr)
 
 ~ProjectModel () override
 
void appendRow (ProjectBaseItem *item)
 
void clear ()
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex indexFromItem (const ProjectBaseItem *item) const
 
bool insertColumns (int column, int count, const QModelIndex &parent=QModelIndex()) override
 
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
ProjectBaseItem * itemAt (int row) const
 
ProjectBaseItem * itemForPath (const IndexedString &path) const
 
ProjectBaseItem * itemFromIndex (const QModelIndex &) const
 
QList< ProjectBaseItem * > itemsForPath (const IndexedString &path) const
 
QModelIndex parent (const QModelIndex &child) const override
 
QStringList pathFromIndex (const QModelIndex &index) const
 
QModelIndex pathToIndex (const QStringList &tofetch) const
 
void removeRow (int row)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
Qt::DropActions supportedDropActions () const override
 
ProjectBaseItem * takeRow (int row)
 
QList< ProjectBaseItem * > topItems () const
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent)
 
virtual ~QAbstractItemModel ()
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
virtual bool canFetchMore (const QModelIndex &parent) const
 
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)
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
virtual void fetchMore (const QModelIndex &parent)
 
virtual bool hasChildren (const QModelIndex &parent) const
 
bool hasIndex (int row, int column, const QModelIndex &parent) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) 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)
 
virtual QMap< int, QVariant > itemData (const QModelIndex &index) const
 
void layoutAboutToBeChanged ()
 
void layoutChanged ()
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
virtual QModelIndex parent (const QModelIndex &index) const=0
 
bool removeColumn (int column, const QModelIndex &parent)
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent)
 
bool removeRow (int row, const QModelIndex &parent)
 
virtual bool removeRows (int row, int count, const QModelIndex &parent)
 
virtual void revert ()
 
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)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
void setSupportedDragActions (QFlags< Qt::DropAction > actions)
 
QModelIndex sibling (int row, int column, const QModelIndex &index) const
 
virtual void sort (int column, Qt::SortOrder order)
 
virtual QSize span (const QModelIndex &index) const
 
virtual bool submit ()
 
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 char *signal, const QObject *receiver, const char *method)
 
bool disconnect (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
 

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)
 
- 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, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
QModelIndex createIndex (int row, int column, void *ptr) 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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Class providing some convenience methods for accessing the project model.

Todo:
: maybe switch to QAbstractItemModel, would make the implementation for at least the checkbox-behaviour easier

Definition at line 420 of file projectmodel.h.

Member Enumeration Documentation

◆ Roles

enum KDevelop::ProjectModel::Roles
Enumerator
ProjectRole 
ProjectItemRole 
UrlRole 
LastRole 

Definition at line 424 of file projectmodel.h.

Constructor & Destructor Documentation

◆ ProjectModel()

KDevelop::ProjectModel::ProjectModel ( QObject *  parent = nullptr)
explicit

Definition at line 1014 of file projectmodel.cpp.

◆ ~ProjectModel()

KDevelop::ProjectModel::~ProjectModel ( )
override

Definition at line 1024 of file projectmodel.cpp.

Member Function Documentation

◆ appendRow()

void KDevelop::ProjectModel::appendRow ( ProjectBaseItem *  item)

Definition at line 1048 of file projectmodel.cpp.

◆ clear()

void KDevelop::ProjectModel::clear ( )

Definition at line 583 of file projectmodel.cpp.

◆ columnCount()

int KDevelop::ProjectModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 941 of file projectmodel.cpp.

◆ data()

QVariant KDevelop::ProjectModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 982 of file projectmodel.cpp.

◆ flags()

Qt::ItemFlags KDevelop::ProjectModel::flags ( const QModelIndex &  index) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1083 of file projectmodel.cpp.

◆ index()

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

Definition at line 1037 of file projectmodel.cpp.

◆ indexFromItem()

QModelIndex KDevelop::ProjectModel::indexFromItem ( const ProjectBaseItem *  item) const

Definition at line 963 of file projectmodel.cpp.

◆ insertColumns()

bool KDevelop::ProjectModel::insertColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1092 of file projectmodel.cpp.

◆ insertRows()

bool KDevelop::ProjectModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1098 of file projectmodel.cpp.

◆ itemAt()

ProjectBaseItem * KDevelop::ProjectModel::itemAt ( int  row) const

Definition at line 1069 of file projectmodel.cpp.

◆ itemForPath()

ProjectBaseItem * KDevelop::ProjectModel::itemForPath ( const IndexedString &  path) const

Returns the first item for the given indexed path.

Definition at line 1117 of file projectmodel.cpp.

◆ itemFromIndex()

ProjectBaseItem * KDevelop::ProjectModel::itemFromIndex ( const QModelIndex &  index) const

Definition at line 971 of file projectmodel.cpp.

◆ itemsForPath()

QList< ProjectBaseItem * > KDevelop::ProjectModel::itemsForPath ( const IndexedString &  path) const
Returns
all items for the given indexed path.

Definition at line 1110 of file projectmodel.cpp.

◆ parent()

QModelIndex KDevelop::ProjectModel::parent ( const QModelIndex &  child) const
override

Definition at line 954 of file projectmodel.cpp.

◆ pathFromIndex()

QStringList KDevelop::ProjectModel::pathFromIndex ( const QModelIndex &  index) const

Definition at line 924 of file projectmodel.cpp.

◆ pathToIndex()

QModelIndex KDevelop::ProjectModel::pathToIndex ( const QStringList &  tofetch) const

Definition at line 889 of file projectmodel.cpp.

◆ removeRow()

void KDevelop::ProjectModel::removeRow ( int  row)

Definition at line 1055 of file projectmodel.cpp.

◆ rowCount()

int KDevelop::ProjectModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 946 of file projectmodel.cpp.

◆ setData()

bool KDevelop::ProjectModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1104 of file projectmodel.cpp.

◆ supportedDropActions()

Qt::DropActions KDevelop::ProjectModel::supportedDropActions ( ) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 492 of file projectmodel.cpp.

◆ takeRow()

ProjectBaseItem * KDevelop::ProjectModel::takeRow ( int  row)

Definition at line 1062 of file projectmodel.cpp.

◆ topItems()

QList< ProjectBaseItem * > KDevelop::ProjectModel::topItems ( ) const

Definition at line 1076 of file projectmodel.cpp.


The documentation for this class was generated from the following files:
  • projectmodel.h
  • projectmodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 23:35:31 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/project

Skip menu "kdevplatform/project"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

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