kleopatra
#include <keylistmodel.h>
|
void | rowAboutToBeMoved (const QModelIndex &old_parent, int old_row) |
|
void | rowMoved (const QModelIndex &new_parent, int new_row) |
|
Definition at line 49 of file keylistmodel.h.
AbstractKeyListModel::AbstractKeyListModel |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
AbstractKeyListModel::~AbstractKeyListModel |
( |
| ) |
|
QModelIndex AbstractKeyListModel::addKey |
( |
const GpgME::Key & |
key | ) |
|
|
slot |
QList< QModelIndex > AbstractKeyListModel::addKeys |
( |
const std::vector< GpgME::Key > & |
keys | ) |
|
|
slot |
void AbstractKeyListModel::clear |
( |
| ) |
|
|
slot |
int AbstractKeyListModel::columnCount |
( |
const QModelIndex & |
pidx | ) |
const |
QVariant AbstractKeyListModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
QVariant AbstractKeyListModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
o, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
QModelIndex Kleo::AbstractKeyListModel::index |
( |
const GpgME::Key & |
key | ) |
const |
|
inlinevirtual |
QModelIndex Kleo::AbstractKeyListModel::index |
( |
const GpgME::Key & |
key, |
|
|
int |
col |
|
) |
| const |
QList< QModelIndex > AbstractKeyListModel::indexes |
( |
const std::vector< GpgME::Key > & |
keys | ) |
const |
|
virtual |
Key AbstractKeyListModel::key |
( |
const QModelIndex & |
idx | ) |
const |
|
virtual |
std::vector< Key > AbstractKeyListModel::keys |
( |
const QList< QModelIndex > & |
indexes | ) |
const |
|
virtual |
void 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 response 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;
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 AbstractKeyListModel::setKeys |
( |
const std::vector< GpgME::Key > & |
keys | ) |
|
|
slot |
void AbstractKeyListModel::setToolTipOptions |
( |
int |
opts | ) |
|
int AbstractKeyListModel::toolTipOptions |
( |
| ) |
const |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:42 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.