subsurface/profile-widget/handleitem.h
Berthold Stoeger bece0a0652 profile: port basic dive editing to QtQuick
This needed a bit of refactoring of the ChartItem code, because
we have to be signaled on drag start. Currently only one handle
can be selected at a time. This was (implicitly) the case anyway,
as far as I can tell.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:17:15 +02:00

38 lines
989 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef DIVEHANDLER_HPP
#define DIVEHANDLER_HPP
#include "qt-quick/chartitem.h"
class HandleItemHandle;
class HandleItemText;
class ProfileView;
class HandleItem {
ChartItemPtr<HandleItemHandle> handle;
ChartItemPtr<ChartTextItem> text;
QString oldText;
public:
HandleItem(ProfileView &view, double dpr, int idx);
~HandleItem();
void setVisible(bool handle, bool text);
void setPos(QPointF point);
QPointF getPos() const;
void setTextPos(QPointF point);
void setText(const QString &text);
void setIdx(int idx); // we may have to rearrange the handles when editing the dive
void del(); // Deletes objects - must not be used any longer
private:
double dpr;
ProfileView &view;
protected:
//void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
//void mousePressEvent(QGraphicsSceneMouseEvent *event);
//void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
public
slots:
//void selfRemove();
//void changeGas();
};
#endif