profile: first rudimentary port of the ToolTipItem to qt-quick

Still behaves weirdly when panning the chart.

No support for moving the ToolTipItem.

Doesn't add information on bookmarks under the mouse cursor.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-06-16 18:24:22 +02:00
parent e3767976a3
commit 13c9218ecf
14 changed files with 260 additions and 48 deletions

View file

@ -5,8 +5,6 @@ set(BACKEND_SRCS
exportfuncs.h
plannershared.cpp
plannershared.h
roundrectitem.cpp
roundrectitem.h
)
add_library(subsurface_backend_shared STATIC ${BACKEND_SRCS})

View file

@ -1,22 +0,0 @@
#include "roundrectitem.h"
#include <QPainter>
#include <QStyleOptionGraphicsItem>
RoundRectItem::RoundRectItem(double radius, QGraphicsItem *parent) : QGraphicsRectItem(parent),
radius(radius)
{
}
RoundRectItem::RoundRectItem(double radius) : RoundRectItem(radius, nullptr)
{
}
void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
{
painter->save();
painter->setClipRect(option->rect);
painter->setPen(pen());
painter->setBrush(brush());
painter->drawRoundedRect(rect(), radius, radius, Qt::AbsoluteSize);
painter->restore();
}

View file

@ -1,16 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef ROUNDRECTITEM_H
#define ROUNDRECTITEM_H
#include <QGraphicsRectItem>
class RoundRectItem : public QGraphicsRectItem {
public:
RoundRectItem(double radius, QGraphicsItem *parent);
RoundRectItem(double radius);
private:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
double radius;
};
#endif