Logo Search packages:      
Sourcecode: qt4-x11 version File versions

Phonon::ObjectDescriptionModel< type > Class Template Reference

#include <Phonon/ObjectDescriptionModel>

Inheritance diagram for Phonon::ObjectDescriptionModel< type >:

QAbstractListModel QAbstractItemModel QObject

List of all members.


Detailed Description

template<ObjectDescriptionType type>
class Phonon::ObjectDescriptionModel< type >

The ObjectDescriptionModel class provides a model from a list of ObjectDescription objects.

ObjectDescriptionModel is a readonly model that supplies a list using ObjectDescription::name() for the text and ObjectDescription::description() for the tooltip. If set the properties "icon" and "available" are used to set the decoration and disable the item (disabled only visually, you can still select and drag it).

It also provides the methods moveUp() and moveDown() to order the list. Additionally drag and drop is possible so that QAbstractItemView::InternalMove can be used. The resulting order of the ObjectDescription::index() values can then be retrieved using tupleIndexOrder().

An example use case would be to give the user a QComboBox to select the output device:

 QComboBox *cb = new QComboBox(parentWidget);
 ObjectDescriptionModel *model = new ObjectDescriptionModel(cb);
 model->setModelData(BackendCapabilities::availableAudioOutputDevices());
 cb->setModel(model);
 cb->setCurrentIndex(0); // select first entry

And to retrieve the selected AudioOutputDevice:

 int cbIndex = cb->currentIndex();
 AudioOutputDevice selectedDevice = model->modelData(cbIndex);

Author:
Matthias Kretz <kretz@kde.org>

Definition at line 190 of file objectdescriptionmodel.h.


Public Slots

void deleteLater ()
virtual void revert ()
virtual bool submit ()

Signals

void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
void destroyed (QObject *=0)
void headerDataChanged (Qt::Orientation orientation, int first, int last)
void layoutAboutToBeChanged ()
void layoutChanged ()

Public Member Functions

bool blockSignals (bool b)
virtual QModelIndex buddy (const QModelIndex &index) const
virtual bool canFetchMore (const QModelIndex &parent) const
const QObjectListchildren () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
virtual void fetchMore (const QModelIndex &parent)
template<typename T>
findChild (const QString &aName=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &aName=QString()) const
Qt::ItemFlags flags (const QModelIndex &index) const
bool hasIndex (int row, int column, const QModelIndex &parent=QModelIndex()) const
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QModelIndex index (int row, int column=0, const QModelIndex &parent=QModelIndex()) const
bool inherits (const char *classname) const
bool insertColumn (int column, const QModelIndex &parent=QModelIndex())
virtual bool insertColumns (int column, int count, const QModelIndex &parent=QModelIndex())
bool insertRow (int row, const QModelIndex &parent=QModelIndex())
virtual bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex())
void installEventFilter (QObject *)
bool isWidgetType () const
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
void killTimer (int id)
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
PHONON_EXPORT_ODM const
QMetaObject
metaObject () const
QMimeDatamimeData (const QModelIndexList &indexes) const
QStringList mimeTypes () const
ObjectDescription< type > modelData (const QModelIndex &index) const
QList< ObjectDescription< type > > modelData () const
void moveDown (const QModelIndex &index)
void moveToThread (QThread *thread)
void moveUp (const QModelIndex &index)
 ObjectDescriptionModel (const QList< ObjectDescription< type > > &data, QObject *parent=0)
 ObjectDescriptionModel (QObject *parent=0)
QString objectName () const
QObjectparent () const
QVariant property (const char *name) const
PHONON_EXPORT_ODM void * qt_metacast (const char *_clname)
bool removeColumn (int column, const QModelIndex &parent=QModelIndex())
virtual bool removeColumns (int column, int count, const QModelIndex &parent=QModelIndex())
void removeEventFilter (QObject *)
bool removeRow (int row, const QModelIndex &parent=QModelIndex())
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
int rowCount (const QModelIndex &parent=QModelIndex()) const
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
void setModelData (const QList< ObjectDescription< type > > &data)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
void setSupportedDragActions (Qt::DropActions)
void setUserData (uint id, QObjectUserData *data)
QModelIndex sibling (int row, int column, const QModelIndex &idx) const
bool signalsBlocked () const
virtual void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
virtual QSize span (const QModelIndex &index) const
int startTimer (int interval)
template<>
const QMetaObject staticMetaObject
template<>
const QMetaObject staticMetaObject
template<>
const QMetaObject staticMetaObject
template<>
const QMetaObject staticMetaObject
template<>
const QMetaObject staticMetaObject
Qt::DropActions supportedDragActions () const
Qt::DropActions supportedDropActions () const
QThreadthread () const
int tupleIndexAtPositionIndex (int positionIndex) const
QList< int > tupleIndexOrder () const
QObjectUserData * userData (uint id) const

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Static Public Attributes

static Q_OBJECT_CHECK
PHONON_EXPORT const
QMetaObject 
staticMetaObject

Protected Member Functions

void beginInsertColumns (const QModelIndex &parent, int first, int last)
void beginInsertRows (const QModelIndex &parent, int first, int last)
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
void beginRemoveRows (const QModelIndex &parent, int first, int last)
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
QModelIndex createIndex (int row, int column, quint32 id) const
QModelIndex createIndex (int row, int column, int id) const
QModelIndex createIndex (int row, int column, void *data=0) const
virtual void customEvent (QEvent *)
bool decodeData (int row, int column, const QModelIndex &parent, QDataStream &stream)
virtual void disconnectNotify (const char *signal)
void encodeData (const QModelIndexList &indexes, QDataStream &stream) const
void endInsertColumns ()
void endInsertRows ()
void endRemoveColumns ()
void endRemoveRows ()
QModelIndexList persistentIndexList () const
int receivers (const char *signal) const
void reset ()
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes

ObjectDescriptionModelData *const d
QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject

Properties

QString objectName
 the name of this object

Friends

class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name)
qFindChildqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildren (const QObject *obj, const QString &name)
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QRegExp &regExp)()
T * qobject_cast (QObject *object)
 QObjectList
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

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

Generated by  Doxygen 1.6.0   Back to index