mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive d/l selection UI: Set the item flags
Now the user can click on the dives that they want to keep. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
797bf49129
commit
f8af0239ce
2 changed files with 7 additions and 0 deletions
|
@ -554,6 +554,12 @@ bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
dataChanged(index, index, QVector<int>() << Qt::CheckStateRole);
|
||||
}
|
||||
|
||||
Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const {
|
||||
if (index.column() != 0)
|
||||
return QAbstractTableModel::flags(index);
|
||||
return QAbstractTableModel::flags(index) | Qt::ItemIsUserCheckable;
|
||||
}
|
||||
|
||||
void DiveImportedModel::setImportedDivesIndexes(int first, int last)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
QVariant data(const QModelIndex& index, int role) const;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
||||
void setImportedDivesIndexes(int first, int last);
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
private:
|
||||
int firstIndex;
|
||||
int lastIndex;
|
||||
|
|
Loading…
Add table
Reference in a new issue