DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaGraphicNote.hpp
Go to the documentation of this file.
1#ifndef SCHEMAGRAPHICNOTE_H
2#define SCHEMAGRAPHICNOTE_H
3
5#include <QColor>
6#include <QFont>
7#include <QGraphicsObject>
8#include <QGraphicsSceneHoverEvent>
9#include <QPen>
10#include <QRectF>
11
12namespace dbse {
13class SchemaGraphicNote : public QGraphicsObject
14{
15 Q_OBJECT
16public:
17 explicit SchemaGraphicNote(const QString& name, const QString& text, QGraphicsObject* parent = nullptr);
18 ~SchemaGraphicNote() = default;
19
20 [[nodiscard]] QRectF boundingRect() const override;
21 [[nodiscard]] QPainterPath shape() const override;
22 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
23
24 [[nodiscard]] QString text() { return m_text; }
25 void update_note(QString text);
26 void open_editor();
27
28protected:
29 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev) override;
30signals:
31 void updated();
32
33private:
34 QString m_name;
35 QString m_text;
36};
37} // namespace dbse
38#endif // SCHEMAGRAPHICNOTE_H
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
QPainterPath shape() const override
SchemaGraphicNote(const QString &name, const QString &text, QGraphicsObject *parent=nullptr)
QRectF boundingRect() const override
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev) override
void update_note(QString text)
Including QT Headers.