mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: fix deprecated QVector constructor
Annoyingly, the replacement has only been available since Qt 5.14. To make the code less messy, implement our own stdToQt conversion helper. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1a0cf0bb44
commit
f193c2ef08
4 changed files with 19 additions and 17 deletions
|
@ -155,12 +155,7 @@ void EditBase<T>::undo()
|
|||
|
||||
// Send signals.
|
||||
DiveField id = fieldId();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
emit diveListNotifier.divesChanged(QVector<dive *>(dives.begin(), dives.end()), id);
|
||||
#else
|
||||
emit diveListNotifier.divesChanged(QVector<dive *>::fromStdVector(dives), id);
|
||||
#endif
|
||||
|
||||
emit diveListNotifier.divesChanged(stdToQt<dive *>(dives), id);
|
||||
setSelection(selectedDives, current);
|
||||
}
|
||||
|
||||
|
@ -551,11 +546,7 @@ void EditTagsBase::undo()
|
|||
|
||||
// Send signals.
|
||||
DiveField id = fieldId();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
emit diveListNotifier.divesChanged(QVector<dive *>(dives.begin(), dives.end()), id);
|
||||
#else
|
||||
emit diveListNotifier.divesChanged(QVector<dive *>::fromStdVector(dives), id);
|
||||
#endif
|
||||
emit diveListNotifier.divesChanged(stdToQt<dive *>(dives), id);
|
||||
setSelection(selectedDives, current);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue