Public Types | Signals | Public Member Functions | Private Member Functions | Private Attributes

conan::ConnectionModel Class Reference

A hierarchical read-only model for a list of ConnectionData. More...

#include <ConnectionModel.h>

List of all members.

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 MethodDataGetMethodData (const QModelIndex &inIndex) const
 Retrieves the MethodData associated with the given index.
const ConnectionDataGetConnectionData (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< ConnectionDatamConnections
 The source data of the model.

Detailed Description

A hierarchical read-only model for a list of ConnectionData.

Note that duplicate connections are marked in yellow.


Member Enumeration Documentation

ConnectionModel columns.

Enumerator:
kSignature 
kObject 
kAddress 
kConnectionType 
kSuperClass 
kAccess 
kColumnCount 

Constructor & Destructor Documentation

conan::ConnectionModel::ConnectionModel ( QObject *  inParent = 0  ) 

Member Function Documentation

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.

Parameters:
[in] inIndex The model index
Returns:
Returns true when there are duplicate connections; otherwise false.
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.

Parameters:
[in] inIndex The model index
Returns:
The corresponding ConnectionData when index has no parent; otherwise 0
const MethodData * conan::ConnectionModel::GetMethodData ( const QModelIndex &  inIndex  )  const

Retrieves the MethodData associated with the given index.

Parameters:
[in] inIndex The model index
Returns:
The corresponding MethodData when 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.

Parameters:
[in] inIndex The model index
Returns:
Returns true when the given index corresponds to a singal; otherwise false.
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.

Parameters:
[in] inConnectionData The connection data
Returns:
The row of the signal/slot that corresponds to the connection data; otherwise -1
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]

Member Data Documentation

The source data of the model.


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