DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaGraphicObject.hpp
Go to the documentation of this file.
1#ifndef SCHEMAGRAPHICOBJECT_H
2#define SCHEMAGRAPHICOBJECT_H
3
5#include <QGraphicsObject>
6#include <QGraphicsSceneHoverEvent>
7#include <QFont>
8#include <QColor>
9#include <QPen>
10
12#include "oks/class.hpp"
13
14namespace dbse
15{
16
17class SchemaGraphicSegmentedArrow;
18
19class SchemaGraphicObject: public QGraphicsObject
20{
21 Q_OBJECT
22public:
23 explicit SchemaGraphicObject ( QString & ClassName, QGraphicsObject * parent = nullptr );
25
26 [[nodiscard]] dunedaq::oks::OksClass * GetClass() const;
27 [[nodiscard]] QString GetClassName() const;
28 void GetInfo();
30 void set_inherited_properties_visibility( bool visible );
31 void set_highlight_active( bool highlight );
32 [[nodiscard]] QRectF boundingRect() const override;
33 [[nodiscard]] QPainterPath shape() const override;
34 void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option,
35 QWidget * widget ) override;
39 void RemoveArrows();
40 bool HasArrow ( SchemaGraphicObject * Dest ) const;
41protected:
42 QVariant itemChange ( GraphicsItemChange change, const QVariant & value );
43 void hoverEnterEvent ( QGraphicsSceneHoverEvent* ev );
44 void hoverLeaveEvent ( QGraphicsSceneHoverEvent* ev );
45 void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent* ev );
46private:
49 QStringList m_class_attributes;
50 QStringList m_class_methods;
52
56
58 bool m_highlight_active{false};
59 QFont m_font;
64
67 QList<SchemaGraphicSegmentedArrow *> m_arrows;
68private slots:
69 void UpdateObject ( QString Name );
70 void RemoveObject ( QString Name );
71};
72
73} // namespace dbse
74#endif // SCHEMAGRAPHICOBJECT_H
void AddArrow(SchemaGraphicSegmentedArrow *Arrow)
Arrow API.
void set_highlight_active(bool highlight)
QList< SchemaGraphicSegmentedArrow * > m_arrows
QPainterPath shape() const override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *ev)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void RemoveArrow(SchemaGraphicSegmentedArrow *Arrow)
void hoverEnterEvent(QGraphicsSceneHoverEvent *ev)
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
SchemaGraphicObject(QString &ClassName, QGraphicsObject *parent=nullptr)
dunedaq::oks::OksClass * GetClass() const
QRectF boundingRect() const override
dunedaq::oks::OksClass * m_class_info
bool HasArrow(SchemaGraphicObject *Dest) const
void set_inherited_properties_visibility(bool visible)
Graphic API.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev)
The OKS class.
Definition class.hpp:200
Including QT Headers.