A hierarchical read-only model for a list of ConnectionData. More...
#include <ConnectionModel.h>
Public Types | |
enum | Columns { kSignature, kObject, kAddress, kConnectionType, kSuperClass, kAccess, kColumnCount } |
ConnectionModel columns. More... | |
Signals | |
void | SignalRequestConfirmation (const QString &title, const QString &message, bool &confirmed) |
Public Member Functions | |
ConnectionModel (QObject *inParent=0) | |
void | SetData (const QVector< ConnectionData > &inConnections) |
Resets the model with new source data. | |
void | Disconnect (const QModelIndex &inIndex) |
Disconnects the specified method. If the index corresponds to ConnectionData, al its children will be diconnected. If the index corresponds to MethodData, it will be disconnected from its parent. | |
virtual int | rowCount (const QModelIndex &inParent=QModelIndex()) const |
Returns the number of rows under the given parent. | |
virtual int | columnCount (const QModelIndex &inParent=QModelIndex()) const |
Returns the number of columns of the model. | |
virtual Qt::ItemFlags | flags (const QModelIndex &inIndex) const |
Returns the item flags for the given index. | |
virtual QVariant | data (const QModelIndex &inIndex, int inRole) const |
Returns the data stored under the given role for the item referred to by the index. | |
virtual QVariant | headerData (int inSection, Qt::Orientation inOrientation, int inRole=Qt::DisplayRole) const |
Returns the data for the given role and section in the header with the specified orientation. | |
virtual QModelIndex | index (int inRow, int inColumn, const QModelIndex &inParent=QModelIndex()) const |
Returns the index of the item in the model specified by the given row, column and parent index. | |
virtual QModelIndex | parent (const QModelIndex &inIndex) const |
Returns the parent of the model item with the given index, or QModelIndex() if it has no parent. | |
const MethodData * | GetMethodData (const QModelIndex &inIndex) const |
Retrieves the MethodData associated with the given index. | |
const ConnectionData * | GetConnectionData (const QModelIndex &inIndex) const |
Retrieves the ConnectionData associated with the given index. | |
bool | IsSignal (const QModelIndex &inIndex) const |
Determines if the given index corresponds to a signal. | |
bool | ContainsDuplicateConnections (const QModelIndex &inIndex) const |
Determines if the ConnectionData, corresponding to the given index or its parent, contains duplicate connections. | |
Private Member Functions | |
int | Row (const ConnectionData *inConnectionData) const |
Returns the row of the signal/slot that corresponds to the given ConnectionData. | |
Private Attributes | |
QVector< ConnectionData > | mConnections |
The source data of the model. |
A hierarchical read-only model for a list of ConnectionData.
Note that duplicate connections are marked in yellow.
ConnectionModel columns.
conan::ConnectionModel::ConnectionModel | ( | QObject * | inParent = 0 |
) |
int conan::ConnectionModel::columnCount | ( | const QModelIndex & | inParent = QModelIndex () |
) | const [virtual] |
Returns the number of columns of the model.
bool conan::ConnectionModel::ContainsDuplicateConnections | ( | const QModelIndex & | inIndex | ) | const |
Determines if the ConnectionData, corresponding to the given index or its parent, contains duplicate connections.
[in] | inIndex | The model index |
QVariant conan::ConnectionModel::data | ( | const QModelIndex & | inIndex, | |
int | inRole | |||
) | const [virtual] |
Returns the data stored under the given role for the item referred to by the index.
void conan::ConnectionModel::Disconnect | ( | const QModelIndex & | inIndex | ) |
Disconnects the specified method. If the index corresponds to ConnectionData, al its children will be diconnected. If the index corresponds to MethodData, it will be disconnected from its parent.
Qt::ItemFlags conan::ConnectionModel::flags | ( | const QModelIndex & | inIndex | ) | const [virtual] |
Returns the item flags for the given index.
const ConnectionData * conan::ConnectionModel::GetConnectionData | ( | const QModelIndex & | inIndex | ) | const |
Retrieves the ConnectionData associated with the given index.
[in] | inIndex | The model index |
index
has no parent; otherwise 0 const MethodData * conan::ConnectionModel::GetMethodData | ( | const QModelIndex & | inIndex | ) | const |
Retrieves the MethodData associated with the given index.
[in] | inIndex | The model index |
index
has a valid parent; otherwise 0 QVariant conan::ConnectionModel::headerData | ( | int | inSection, | |
Qt::Orientation | inOrientation, | |||
int | inRole = Qt::DisplayRole | |||
) | const [virtual] |
Returns the data for the given role and section in the header with the specified orientation.
QModelIndex conan::ConnectionModel::index | ( | int | inRow, | |
int | inColumn, | |||
const QModelIndex & | inParent = QModelIndex () | |||
) | const [virtual] |
Returns the index of the item in the model specified by the given row, column and parent index.
The internal pointer of an index is set to zero for indices that refer to top level signals/slots. For connected methods the internal pointer is set to the ConnectionData that contains them.
bool conan::ConnectionModel::IsSignal | ( | const QModelIndex & | inIndex | ) | const |
Determines if the given index corresponds to a signal.
[in] | inIndex | The model index |
QModelIndex conan::ConnectionModel::parent | ( | const QModelIndex & | inIndex | ) | const [virtual] |
Returns the parent of the model item with the given index, or QModelIndex() if it has no parent.
Only items referring to connected methods have a parent.
int conan::ConnectionModel::Row | ( | const ConnectionData * | inConnectionData | ) | const [private] |
Returns the row of the signal/slot that corresponds to the given ConnectionData.
[in] | inConnectionData | The connection data |
int conan::ConnectionModel::rowCount | ( | const QModelIndex & | inParent = QModelIndex () |
) | const [virtual] |
Returns the number of rows under the given parent.
void conan::ConnectionModel::SetData | ( | const QVector< ConnectionData > & | inConnections | ) |
Resets the model with new source data.
void conan::ConnectionModel::SignalRequestConfirmation | ( | const QString & | title, | |
const QString & | message, | |||
bool & | confirmed | |||
) | [signal] |
QVector<ConnectionData> conan::ConnectionModel::mConnections [private] |
The source data of the model.