2023-06-16 18:24:22 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef PROFILE_TOOLTIPITEM_H
|
|
|
|
#define PROFILE_TOOLTIPITEM_H
|
|
|
|
|
|
|
|
#include "qt-quick/chartitem.h"
|
|
|
|
|
|
|
|
#include <QFont>
|
2024-01-12 22:26:32 +01:00
|
|
|
#include <QFontMetrics>
|
2023-06-16 18:24:22 +02:00
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
struct dive;
|
|
|
|
struct plot_info;
|
|
|
|
|
2023-07-06 16:08:19 +02:00
|
|
|
class ToolTipItem : public AnimatedChartRectItem {
|
2023-06-16 18:24:22 +02:00
|
|
|
public:
|
|
|
|
ToolTipItem(ChartView &view, double dpr);
|
2023-07-01 21:42:16 +02:00
|
|
|
void update(const dive *d, double dpr, int time, const plot_info &pInfo,
|
2023-07-06 16:08:19 +02:00
|
|
|
const std::vector<std::pair<QString, QPixmap>> &events, bool inPlanner, int animSpeed);
|
2023-06-16 18:24:22 +02:00
|
|
|
private:
|
|
|
|
QFont font;
|
|
|
|
QFontMetrics fm;
|
|
|
|
double fontHeight;
|
|
|
|
QPixmap title;
|
|
|
|
double width, height;
|
|
|
|
|
|
|
|
QPixmap stringToPixmap(const QString &s) const;
|
2023-06-25 17:31:58 +02:00
|
|
|
|
|
|
|
void stopDrag(QPointF pos) override;
|
2023-06-16 18:24:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PROFILE_TOOLTIPITEM
|