Marble

LabelGraphicsItem.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2009 Bastian Holst <bastianholst@gmx.de>
4//
5
6#ifndef MARBLE_LABELGRAPHICSITEM_H
7#define MARBLE_LABELGRAPHICSITEM_H
8
9// Marble
10#include "FrameGraphicsItem.h"
11#include "marble_export.h"
12
13#include <QSize>
14
15class QImage;
16class QIcon;
17
18namespace Marble
19{
20
21class LabelGraphicsItemPrivate;
22
23/**
24 * A label item provides an Item that displays text or images/pixmaps.
25 * The text is displayed as plain text.
26 * The item also provides frames.
27 */
28class MARBLE_EXPORT LabelGraphicsItem : public FrameGraphicsItem
29{
30public:
31 explicit LabelGraphicsItem(MarbleGraphicsItem *parent = nullptr);
32 ~LabelGraphicsItem() override;
33
34 void setContentSize(const QSizeF &contentSize) override;
35
36 QString text() const;
37 void setText(const QString &text);
38
39 QImage image() const;
40 void setImage(const QImage &image, const QSize &size = QSize());
41
42 QIcon icon() const;
43 void setIcon(const QIcon &icon, const QSize &size);
44
45 void setMinimumSize(const QSizeF &size);
46 QSizeF minimumSize() const;
47
48 void clear();
49
50protected:
51 void paintContent(QPainter *painter) override;
52
53private:
54 Q_DISABLE_COPY(LabelGraphicsItem)
55 Q_DECLARE_PRIVATE(LabelGraphicsItem)
56};
57
58} // namespace Marble
59
60#endif
A label item provides an Item that displays text or images/pixmaps.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.