mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
e3767976a3
commit
13c9218ecf
14 changed files with 260 additions and 48 deletions
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue