aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-22 08:06:07 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-23 13:22:24 -0800
commit9e565e355221d38c05d19002f040d6af7ce07735 (patch)
treebf55a546433dfff3c1ed9058b0ce6b254d33c70d /qt-models/divetripmodel.cpp
parentfba6ec5ad500f0106a1590f061a583376dcbd23d (diff)
downloadsubsurface-9e565e355221d38c05d19002f040d6af7ce07735.tar.gz
Cleanup: make "struct dive *" and "struct dive_trip *" Qt metatypes
Just as we did for pointer to struct dive_site, make pointers to struct dive and struct dive_trip "Qt metatypes". This means that they can be passed through QVariants without taking a detour via void *. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index c2d9e62a9..51284c41d 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -51,7 +51,7 @@ QVariant DiveTripModel::tripData(const dive_trip *trip, int column, int role)
bool oneDayTrip=true;
if (role == TRIP_ROLE)
- return QVariant::fromValue<void *>((void *)trip); // Not nice: casting away a const
+ return QVariant::fromValue(const_cast<dive_trip *>(trip)); // Not nice: casting away a const
if (role == Qt::DisplayRole) {
switch (column) {
@@ -248,7 +248,7 @@ QVariant DiveTripModel::diveData(const struct dive *d, int column, int role)
case STAR_ROLE:
return d->rating;
case DIVE_ROLE:
- return QVariant::fromValue<void *>((void *)d); // Not nice: casting away a const
+ return QVariant::fromValue(const_cast<dive *>(d)); // Not nice: casting away a const
case DIVE_IDX:
return get_divenr(d);
case SELECTED_ROLE: