subsurface/profile-widget/ruleritem.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

33 lines
706 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef RULERITEM_H
#define RULERITEM_H
#include "qt-quick/chartitem.h"
#include <QFont>
#include <QFontMetrics>
class ProfileView;
class ProfileScene;
class RulerItemHandle;
struct plot_info;
struct dive;
class RulerItem {
ChartItemPtr<ChartLineItem> line;
ChartItemPtr<RulerItemHandle> handle1, handle2;
ChartItemPtr<AnimatedChartRectItem> tooltip;
QFont font;
QFontMetrics fm;
double fontHeight;
QPixmap title;
public:
RulerItem(ProfileView &view, double dpr);
~RulerItem();
void setVisible(bool visible);
void update(const dive *d, double dpr, const ProfileScene &scene, const plot_info &info, int animspeed);
void anim(double progress);
};
#endif