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 <QGraphicsObject>
6#include <QGraphicsSceneHoverEvent>
7#include <QFont>
8#include <QColor>
9#include <QPen>
10#include <QRectF>
11
12namespace dbse
13{
14 class SchemaGraphicNote : public QGraphicsObject
15 {
16 Q_OBJECT
17 public:
18
19 explicit SchemaGraphicNote ( const QString& name, const QString& text,
20 QGraphicsObject* parent = nullptr );
21 ~SchemaGraphicNote() = default;
22
23 [[nodiscard]] QRectF boundingRect() const override;
24 [[nodiscard]] QPainterPath shape() const override;
25 void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option,
26 QWidget * widget ) override;
27
28
29 [[nodiscard]] QString text() {return m_text;}
30 void update_note (QString text);
31 void open_editor();
32 protected:
33 void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent* ev ) override;
34 signals:
35 void updated();
36
37 private:
38 QString m_name;
39 QString m_text;
40 QFont m_font;
45
46
47 };
48} // namespace dbse
49#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.