kleopatra
Kleo::AbstractKeyListModel Class Reference
#include <keylistmodel.h>

Detailed Description
Definition at line 49 of file keylistmodel.h.
Public Types | |
| enum | Columns { PrettyName, PrettyEMail, ValidFrom, ValidUntil, TechnicalDetails, Fingerprint, NumColumns, Icon = PrettyName } |
Public Slots | |
| QModelIndex | addKey (const GpgME::Key &key) |
| QList< QModelIndex > | addKeys (const std::vector< GpgME::Key > &keys) |
| void | clear () |
| void | removeKey (const GpgME::Key &key) |
| void | setKeys (const std::vector< GpgME::Key > &keys) |
Signals | |
| void | rowAboutToBeMoved (const QModelIndex &old_parent, int old_row) |
| void | rowMoved (const QModelIndex &new_parent, int new_row) |
Public Member Functions | |
| AbstractKeyListModel (QObject *parent=0) | |
| int | columnCount (const QModelIndex &pidx) const |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| QVariant | headerData (int section, Qt::Orientation o, int role=Qt::DisplayRole) const |
| QModelIndex | index (const GpgME::Key &key, int col) const |
| QModelIndex | index (const GpgME::Key &key) const |
| QList< QModelIndex > | indexes (const std::vector< GpgME::Key > &keys) const |
| GpgME::Key | key (const QModelIndex &idx) const |
| std::vector< GpgME::Key > | keys (const QList< QModelIndex > &indexes) const |
| void | setToolTipOptions (int opts) |
| int | toolTipOptions () const |
| ~AbstractKeyListModel () | |
Static Public Member Functions | |
| static AbstractKeyListModel * | createFlatKeyListModel (QObject *parent=0) |
| static AbstractKeyListModel * | createHierarchicalKeyListModel (QObject *parent=0) |
Member Enumeration Documentation
- Enumerator:
-
PrettyName PrettyEMail ValidFrom ValidUntil TechnicalDetails Fingerprint NumColumns Icon
Definition at line 58 of file keylistmodel.h.
Constructor & Destructor Documentation
| AbstractKeyListModel::AbstractKeyListModel | ( | QObject * | parent = 0 |
) | [explicit] |
Definition at line 82 of file keylistmodel.cpp.
| AbstractKeyListModel::~AbstractKeyListModel | ( | ) |
Definition at line 88 of file keylistmodel.cpp.
Member Function Documentation
| QModelIndex Kleo::AbstractKeyListModel::addKey | ( | const GpgME::Key & | key | ) | [slot] |
| QList<QModelIndex> Kleo::AbstractKeyListModel::addKeys | ( | const std::vector< GpgME::Key > & | keys | ) | [slot] |
| void AbstractKeyListModel::clear | ( | ) | [slot] |
Definition at line 161 of file keylistmodel.cpp.
| int AbstractKeyListModel::columnCount | ( | const QModelIndex & | pidx | ) | const |
Definition at line 166 of file keylistmodel.cpp.
| AbstractKeyListModel * AbstractKeyListModel::createFlatKeyListModel | ( | QObject * | parent = 0 |
) | [static] |
Definition at line 779 of file keylistmodel.cpp.
| AbstractKeyListModel * AbstractKeyListModel::createHierarchicalKeyListModel | ( | QObject * | parent = 0 |
) | [static] |
Definition at line 788 of file keylistmodel.cpp.
| QVariant AbstractKeyListModel::data | ( | const QModelIndex & | index, | |
| int | role = Qt::DisplayRole | |||
| ) | const |
Definition at line 199 of file keylistmodel.cpp.
| QVariant AbstractKeyListModel::headerData | ( | int | section, | |
| Qt::Orientation | o, | |||
| int | role = Qt::DisplayRole | |||
| ) | const |
Definition at line 170 of file keylistmodel.cpp.
| QModelIndex Kleo::AbstractKeyListModel::index | ( | const GpgME::Key & | key, | |
| int | col | |||
| ) | const |
| QModelIndex Kleo::AbstractKeyListModel::index | ( | const GpgME::Key & | key | ) | const [inline, virtual] |
| QList<QModelIndex> Kleo::AbstractKeyListModel::indexes | ( | const std::vector< GpgME::Key > & | keys | ) | const [virtual] |
Implements Kleo::KeyListModelInterface.
| Key AbstractKeyListModel::key | ( | const QModelIndex & | idx | ) | const [virtual] |
| std::vector< Key > AbstractKeyListModel::keys | ( | const QList< QModelIndex > & | indexes | ) | const [virtual] |
| void Kleo::AbstractKeyListModel::removeKey | ( | const GpgME::Key & | key | ) | [slot] |
| AbstractKeyListModel::rowAboutToBeMoved | ( | const QModelIndex & | old_parent, | |
| int | old_row | |||
| ) | [signal] |
Emitted before the removal of a row from that model. It will later be added to the model again, in reponse to which rowMoved() will be emitted. If multiple rows are moved in one go, multiple rowAboutToBeMoved() signals are emitted before the corresponding number of rowMoved() signals is emitted - in reverse order.
This works around the absence of move semantics in QAbstractItemModel. Clients can maintain a stack to perform the QModelIndex-mapping themselves, or, e.g., to preserve the selection status of the row:
std::vector<bool> mMovingRowWasSelected; // transient, used when rows are moved // ... void slotRowAboutToBeMoved( const QModelIndex & p, int row ) { mMovingRowWasSelected.push_back( selectionModel()->isSelected( model()->index( row, 0, p ) ) ); } void slotRowMoved( const QModelIndex & p, int row ) { const bool wasSelected = mMovingRowWasSelected.back(); mMovingRowWasSelected.pop_back(); if ( wasSelected ) selectionModel()->select( model()->index( row, 0, p ), Select|Rows ); }
A similar mechanism could be used to preserve the current item during moves.
| AbstractKeyListModel::rowMoved | ( | const QModelIndex & | new_parent, | |
| int | new_parent | |||
| ) | [signal] |
| void Kleo::AbstractKeyListModel::setKeys | ( | const std::vector< GpgME::Key > & | keys | ) | [slot] |
| void AbstractKeyListModel::setToolTipOptions | ( | int | opts | ) |
Definition at line 90 of file keylistmodel.cpp.
| int AbstractKeyListModel::toolTipOptions | ( | ) | const |
defines which information is displayed in tooltips see Kleo::Formatting::ToolTipOption
Definition at line 95 of file keylistmodel.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference