mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: remove DiveLineItem
This was an empty wrapper around QGraphicsLineItem. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
faf18ef36b
commit
76faecb379
10 changed files with 2 additions and 65 deletions
|
@ -180,7 +180,6 @@ SOURCES += subsurface-mobile-main.cpp \
|
|||
profile-widget/pictureitem.cpp \
|
||||
profile-widget/tankitem.cpp \
|
||||
profile-widget/tooltipitem.cpp \
|
||||
profile-widget/divelineitem.cpp \
|
||||
profile-widget/divetextitem.cpp \
|
||||
profile-widget/handleitem.cpp \
|
||||
profile-widget/profileview.cpp \
|
||||
|
@ -344,7 +343,6 @@ HEADERS += \
|
|||
profile-widget/tooltipitem.h \
|
||||
profile-widget/animationfunctions.h \
|
||||
profile-widget/divecartesianaxis.h \
|
||||
profile-widget/divelineitem.h \
|
||||
profile-widget/divepixmapcache.h \
|
||||
profile-widget/divetextitem.h \
|
||||
profile-widget/handleitem.h \
|
||||
|
|
|
@ -6,8 +6,6 @@ set(SUBSURFACE_PROFILE_LIB_SRCS
|
|||
divecartesianaxis.h
|
||||
diveeventitem.cpp
|
||||
diveeventitem.h
|
||||
divelineitem.cpp
|
||||
divelineitem.h
|
||||
divepixmapcache.cpp
|
||||
divepixmapcache.h
|
||||
divepercentageitem.cpp
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "core/qthelper.h"
|
||||
#include "core/subsurface-float.h"
|
||||
#include "profile-widget/animationfunctions.h"
|
||||
#include "profile-widget/divelineitem.h"
|
||||
#include "profile-widget/profilescene.h"
|
||||
|
||||
static const double labelSpaceHorizontal = 2.0; // space between label and ticks
|
||||
|
@ -277,7 +276,7 @@ DiveCartesianAxis::Label DiveCartesianAxis::createLabel(double value, double pos
|
|||
if (lineVisibility) {
|
||||
label.lineStart = linePos(posStart);
|
||||
label.lineEnd = linePos(pos);
|
||||
label.line = std::make_unique<DiveLineItem>(this);
|
||||
label.line = std::make_unique<QGraphicsLineItem>(this);
|
||||
label.line->setPen(gridPen);
|
||||
label.line->setZValue(0);
|
||||
label.line->setLine(animSpeed <= 0 ? label.lineEnd : label.lineStart);
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
class ProfileScene;
|
||||
class DiveTextItem;
|
||||
class DiveLineItem;
|
||||
|
||||
class DiveCartesianAxis : public QGraphicsLineItem {
|
||||
private:
|
||||
|
@ -57,7 +56,7 @@ private:
|
|||
QLineF lineStart;
|
||||
QLineF lineEnd;
|
||||
std::unique_ptr<DiveTextItem> label;
|
||||
std::unique_ptr<DiveLineItem> line;
|
||||
std::unique_ptr<QGraphicsLineItem> line;
|
||||
};
|
||||
Position position;
|
||||
bool inverted; // Top-to-bottom or right-to-left axis.
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "divelineitem.h"
|
||||
|
||||
DiveLineItem::DiveLineItem(QGraphicsItem *parent) : QGraphicsLineItem(parent)
|
||||
{
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef DIVELINEITEM_H
|
||||
#define DIVELINEITEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QGraphicsLineItem>
|
||||
|
||||
class DiveLineItem : public QObject, public QGraphicsLineItem {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
|
||||
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
|
||||
public:
|
||||
DiveLineItem(QGraphicsItem *parent = 0);
|
||||
};
|
||||
|
||||
#endif // DIVELINEITEM_H
|
|
@ -5,8 +5,6 @@
|
|||
#include <QGraphicsPolygonItem>
|
||||
#include <memory>
|
||||
|
||||
#include "divelineitem.h"
|
||||
|
||||
#include "core/equipment.h"
|
||||
|
||||
/* This is the Profile Item, it should be used for quite a lot of things
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "profile-widget/divetooltipitem.h"
|
||||
#include "profile-widget/divehandler.h"
|
||||
#include "core/planner.h"
|
||||
#include "profile-widget/ruleritem.h"
|
||||
#include "core/pref.h"
|
||||
#include "qt-models/diveplannermodel.h"
|
||||
#include "qt-models/models.h"
|
||||
|
@ -60,11 +59,6 @@ ProfileWidget2::ProfileWidget2(DivePlannerPointsModel *plannerModelIn, double dp
|
|||
dc(0),
|
||||
empty(true),
|
||||
panning(false),
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
mouseFollowerVertical(new DiveLineItem()),
|
||||
mouseFollowerHorizontal(new DiveLineItem()),
|
||||
rulerItem(new RulerItem2()),
|
||||
#endif
|
||||
shouldCalculateMax(true)
|
||||
{
|
||||
setupSceneAndFlags();
|
||||
|
@ -113,15 +107,8 @@ void ProfileWidget2::addItemsToScene()
|
|||
{
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
scene()->addItem(toolTipItem);
|
||||
scene()->addItem(rulerItem);
|
||||
scene()->addItem(rulerItem->sourceNode());
|
||||
scene()->addItem(rulerItem->destNode());
|
||||
scene()->addItem(mouseFollowerHorizontal);
|
||||
scene()->addItem(mouseFollowerVertical);
|
||||
QPen pen(QColor(Qt::red).lighter());
|
||||
pen.setWidth(0);
|
||||
mouseFollowerHorizontal->setPen(pen);
|
||||
mouseFollowerVertical->setPen(pen);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -130,10 +117,6 @@ void ProfileWidget2::setupItemOnScene()
|
|||
#ifndef SUBSURFACE_MOBILE
|
||||
toolTipItem->setZValue(9998);
|
||||
toolTipItem->setTimeAxis(profileScene->timeAxis);
|
||||
rulerItem->setZValue(9997);
|
||||
rulerItem->setAxis(profileScene->timeAxis, profileScene->profileYAxis);
|
||||
mouseFollowerHorizontal->setZValue(9996);
|
||||
mouseFollowerVertical->setZValue(9995);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -182,8 +165,6 @@ void ProfileWidget2::plotDive(const struct dive *dIn, int dcIn, int flags)
|
|||
#ifndef SUBSURFACE_MOBILE
|
||||
toolTipItem->setVisible(prefs.infobox);
|
||||
toolTipItem->setPlotInfo(profileScene->plotInfo);
|
||||
rulerItem->setVisible(prefs.rulergraph && currentState != PLAN && currentState != EDIT);
|
||||
rulerItem->setPlotInfo(d, profileScene->plotInfo);
|
||||
|
||||
if ((currentState == EDIT || currentState == PLAN) && plannerModel) {
|
||||
repositionDiveHandlers();
|
||||
|
@ -273,9 +254,6 @@ void ProfileWidget2::setProfileState()
|
|||
#ifndef SUBSURFACE_MOBILE
|
||||
toolTipItem->readPos();
|
||||
toolTipItem->setVisible(prefs.infobox);
|
||||
rulerItem->setVisible(prefs.rulergraph);
|
||||
mouseFollowerHorizontal->setVisible(false);
|
||||
mouseFollowerVertical->setVisible(false);
|
||||
#endif
|
||||
|
||||
handles.clear();
|
||||
|
@ -289,8 +267,6 @@ void ProfileWidget2::setEditState(const dive *d, int dc)
|
|||
return;
|
||||
|
||||
setProfileState(d, dc);
|
||||
mouseFollowerHorizontal->setVisible(true);
|
||||
mouseFollowerVertical->setVisible(true);
|
||||
|
||||
currentState = EDIT;
|
||||
|
||||
|
@ -303,8 +279,6 @@ void ProfileWidget2::setPlanState(const dive *d, int dc)
|
|||
return;
|
||||
|
||||
setProfileState(d, dc);
|
||||
mouseFollowerHorizontal->setVisible(true);
|
||||
mouseFollowerVertical->setVisible(true);
|
||||
|
||||
currentState = PLAN;
|
||||
setBackgroundBrush(QColor("#D7E3EF"));
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
// *
|
||||
// * It needs to be dynamic, things should *flow* on it, not just appear / disappear.
|
||||
// */
|
||||
#include "profile-widget/divelineitem.h"
|
||||
#include "core/units.h"
|
||||
#include "core/subsurface-qt/divelistnotifier.h"
|
||||
|
||||
|
@ -129,11 +128,6 @@ private:
|
|||
bool panning; // Currently panning.
|
||||
double panningOriginalMousePosition;
|
||||
double panningOriginalProfilePosition;
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
DiveLineItem *mouseFollowerVertical;
|
||||
DiveLineItem *mouseFollowerHorizontal;
|
||||
RulerItem2 *rulerItem;
|
||||
#endif
|
||||
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
void repositionDiveHandlers();
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#ifndef TANKITEM_H
|
||||
#define TANKITEM_H
|
||||
|
||||
#include "profile-widget/divelineitem.h"
|
||||
#include "core/gas.h"
|
||||
#include <QGraphicsRectItem>
|
||||
#include <QBrush>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue