blob: 906cbcf8dd8581e6c6d131db8e7225079270b53b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef TEXTITEM_H
#define TEXTITEM_H
#include "gvbwidget.h"
class QPainter;
class QStyleOptionGraphicsItem;
class QGraphicsTextItem;
class Label : public GvbWidget
{
Q_OBJECT
public:
Label(const QString& text, QGraphicsItem *parent = nullptr);
~Label();
public:
void setText(const QString& text);
QString text() const;
void setFont(const QFont font);
private:
void resizeEvent(QGraphicsSceneResizeEvent *event);
QSizeF sizeHint(Qt::SizeHint which,
const QSizeF &constraint = QSizeF()) const;
private:
Q_DISABLE_COPY(Label)
QGraphicsSimpleTextItem *m_textItem;
};
#endif
|