profile: remove DivePixmapItem

After porting the picture-items to qt-quick, all that was left
of DivePixmapItem was an empty hull. Remove it. The only problem
was that the DiveEventItem is not derived from QObject anymore,
so we have to explicitly add the translation functions with the
Q_DECLARE_TR_FUNCTIONS macro.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-08-12 23:07:12 +02:00
parent ebf9ce6d86
commit eb081f4564
6 changed files with 5 additions and 32 deletions

View file

@ -177,7 +177,6 @@ SOURCES += subsurface-mobile-main.cpp \
profile-widget/profilescene.cpp \
profile-widget/animationfunctions.cpp \
profile-widget/divepixmapcache.cpp \
profile-widget/divepixmapitem.cpp \
profile-widget/pictureitem.cpp \
profile-widget/tankitem.cpp \
profile-widget/tooltipitem.cpp \
@ -346,7 +345,6 @@ HEADERS += \
profile-widget/divecartesianaxis.h \
profile-widget/divelineitem.h \
profile-widget/divepixmapcache.h \
profile-widget/divepixmapitem.h \
profile-widget/diverectitem.h \
profile-widget/divetextitem.h \
profile-widget/profileview.h

View file

@ -10,8 +10,6 @@ set(SUBSURFACE_PROFILE_LIB_SRCS
divelineitem.h
divepixmapcache.cpp
divepixmapcache.h
divepixmapitem.cpp
divepixmapitem.h
divepercentageitem.cpp
divepercentageitem.h
diveprofileitem.cpp

View file

@ -18,7 +18,7 @@ static int depthAtTime(const plot_info &pi, duration_t time);
DiveEventItem::DiveEventItem(const struct dive *d, int idx, const struct event &ev, struct gasmix lastgasmix,
const plot_info &pi, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis,
int speed, const DivePixmaps &pixmaps, QGraphicsItem *parent) : DivePixmapItem(parent),
int speed, const DivePixmaps &pixmaps, QGraphicsItem *parent) : QGraphicsPixmapItem(parent),
text(setupToolTipString(d, ev, lastgasmix)),
pixmap(setupPixmap(d, ev, lastgasmix, pixmaps)),
vAxis(vAxis),

View file

@ -2,16 +2,17 @@
#ifndef DIVEEVENTITEM_H
#define DIVEEVENTITEM_H
#include "divepixmapitem.h"
#include "core/event.h"
#include <QCoreApplication> // for Q_DECLARE_TR_FUNCTIONS
#include <QGraphicsPixmapItem>
class DiveCartesianAxis;
class DivePixmaps;
struct event;
struct plot_info;
class DiveEventItem : public DivePixmapItem {
Q_OBJECT
class DiveEventItem : public QGraphicsPixmapItem {
Q_DECLARE_TR_FUNCTIONS(DiveEventItem)
public:
DiveEventItem(const struct dive *d, int idx, const struct event &ev, struct gasmix lastgasmix,
const struct plot_info &pi, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis,

View file

@ -1,6 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
#include "profile-widget/divepixmapitem.h"
DivePixmapItem::DivePixmapItem(QGraphicsItem *parent) : QGraphicsPixmapItem(parent)
{
}

View file

@ -1,18 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef DIVEPIXMAPITEM_H
#define DIVEPIXMAPITEM_H
#include <QObject>
#include <QGraphicsPixmapItem>
class DivePixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
Q_PROPERTY(QPointF pos WRITE setPos READ pos)
Q_PROPERTY(qreal x WRITE setX READ x)
Q_PROPERTY(qreal y WRITE setY READ y)
public:
DivePixmapItem(QGraphicsItem *parent = 0);
};
#endif // DIVEPIXMAPITEM_H