mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
38 lines
989 B
C++
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
|