Marble

LabelGraphicsItem.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Bastian Holst <[email protected]>
9 //
10 
11 #ifndef MARBLE_LABELGRAPHICSITEM_H
12 #define MARBLE_LABELGRAPHICSITEM_H
13 
14 // Marble
15 #include "FrameGraphicsItem.h"
16 #include "marble_export.h"
17 
18 #include <QSize>
19 
20 class QImage;
21 class QIcon;
22 
23 namespace Marble
24 {
25 
26 class LabelGraphicsItemPrivate;
27 
33 class MARBLE_EXPORT LabelGraphicsItem : public FrameGraphicsItem
34 {
35  public:
36  explicit LabelGraphicsItem( MarbleGraphicsItem *parent = nullptr );
37  ~LabelGraphicsItem() override;
38 
39  void setContentSize( const QSizeF &contentSize ) override;
40 
41  QString text() const;
42  void setText( const QString& text );
43 
44  QImage image() const;
45  void setImage( const QImage& image, const QSize& size = QSize() );
46 
47  QIcon icon() const;
48  void setIcon( const QIcon& icon, const QSize& size );
49 
50  void setMinimumSize( const QSizeF& size );
51  QSizeF minimumSize() const;
52 
53  void clear();
54 
55  protected:
56  void paintContent( QPainter *painter ) override;
57 
58  private:
59  Q_DISABLE_COPY( LabelGraphicsItem )
60  Q_DECLARE_PRIVATE(LabelGraphicsItem)
61 };
62 
63 } // namespace Marble
64 
65 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
A label item provides an Item that displays text or images/pixmaps.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Dec 3 2020 23:21:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.