mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
ui: create a RoundRectItem class
Factor out code from ProfileWidget's ToolTipItem, but make the radius of the corners dynamic. Move into backend-shared, though a new ui-shared might be preferred. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9759d5b21a
commit
b188560ae5
6 changed files with 40 additions and 15 deletions
15
backend-shared/roundrectitem.h
Normal file
15
backend-shared/roundrectitem.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef ROUNDRECTITEM_H
|
||||
#define ROUNDRECTITEM_H
|
||||
|
||||
#include <QGraphicsRectItem>
|
||||
|
||||
class RoundRectItem : public QGraphicsRectItem {
|
||||
public:
|
||||
RoundRectItem(double radius, QGraphicsItem *parent);
|
||||
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