wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
Text.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
11
18class Text : public GraphicElement
19{
20 Q_OBJECT
21 friend class TestGraphicElement;
22
23public:
25 explicit Text(QGraphicsItem *parent = nullptr);
26
28 QRectF boundingRect() const override;
29
31 void updateTheme() override;
32
33protected:
36 void labelContentChanged() override;
37
38private:
39 QGraphicsSimpleTextItem *m_emptyHint = new QGraphicsSimpleTextItem(this);
40};
Abstract base class for all graphical circuit elements.
GraphicElement(ElementType type, QGraphicsItem *parent=nullptr)
Constructs a graphic element of the given type, fetching all properties from the metadata registry.
friend class TestGraphicElement
Definition Text.h:21
Text(QGraphicsItem *parent=nullptr)
Constructs a Text element.
Definition Text.cpp:48
void updateTheme() override
Refreshes the empty-state hint's color alongside the base label/port theming.
Definition Text.cpp:69
void labelContentChanged() override
Definition Text.cpp:80
QRectF boundingRect() const override
Returns a bounding rect that includes the label text, not just the pixmap.
Definition Text.cpp:64