mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive d/l selection UI: remove setData() method
Since we now track all clicks on the row, having the setData() actually neutralized the action that we took on the clicked() signal. Now you can select / deselect a dive, regardless where in the row you click. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4d26e3a0cb
commit
a92484e4ed
2 changed files with 0 additions and 17 deletions
|
@ -586,22 +586,6 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
|
||||||
{
|
|
||||||
if (!index.isValid())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (index.row() + firstIndex > lastIndex)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (role != Qt::CheckStateRole)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
checkStates[index.row()] = value.toBool();
|
|
||||||
dataChanged(index, index, QVector<int>() << Qt::CheckStateRole);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiveImportedModel::changeSelected(QModelIndex clickedIndex)
|
void DiveImportedModel::changeSelected(QModelIndex clickedIndex)
|
||||||
{
|
{
|
||||||
checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()];
|
checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()];
|
||||||
|
|
|
@ -34,7 +34,6 @@ public:
|
||||||
int rowCount(const QModelIndex& index = QModelIndex()) const;
|
int rowCount(const QModelIndex& index = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex& index, int role) const;
|
QVariant data(const QModelIndex& index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||||
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
|
||||||
void setImportedDivesIndexes(int first, int last);
|
void setImportedDivesIndexes(int first, int last);
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
void removeUnused();
|
void removeUnused();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue