Marble

AbstractFloatItem.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 2008 Torsten Rahn <[email protected]>
9 // Copyright 2012 Illya Kovalevskyy <[email protected]>
10 //
11 
12 #ifndef MARBLE_ABSTRACTFLOATITEM_H
13 #define MARBLE_ABSTRACTFLOATITEM_H
14 
15 #include <QPointF>
16 #include <QSizeF>
17 
18 #include "RenderPlugin.h"
19 #include "FrameGraphicsItem.h"
20 #include "marble_export.h"
21 
22 class QContextMenuEvent;
23 class QHelpEvent;
24 class QMenu;
25 class QWidget;
26 class QFont;
27 class QPen;
28 
29 namespace Marble
30 {
31 
32 class AbstractFloatItemPrivate;
33 
44 class MARBLE_EXPORT AbstractFloatItem : public RenderPlugin, public FrameGraphicsItem
45 {
46  Q_OBJECT
47 
48  public:
49  explicit AbstractFloatItem( const MarbleModel *marbleModel,
50  const QPointF &point = QPointF( 10.0, 10.0 ),
51  const QSizeF &size = QSizeF( 150.0, 50.0 ) );
52  ~AbstractFloatItem() override;
53 
54  QHash<QString,QVariant> settings() const override;
55  void setSettings(const QHash<QString, QVariant> &settings) override;
56 
57  RenderType renderType() const override;
58 
63  QPen pen() const;
64 
69  void setPen( const QPen &pen );
70 
75  QFont font() const;
76 
81  void setFont( const QFont &font );
82 
88  MARBLE_DEPRECATED bool render( GeoPainter *painter, ViewportParams *viewport,
89  const QString& renderPos = QLatin1String("FLOAT_ITEM"),
90  GeoSceneLayer * layer = nullptr ) override;
91 
92  QString renderPolicy() const override;
93 
99  MARBLE_DEPRECATED QStringList renderPosition() const override;
100 
109  void setVisible( bool visible );
110 
119  bool visible() const;
120 
131  bool positionLocked() const;
132 
133  public Q_SLOTS:
144  void setPositionLocked( bool lock );
145 
152  void show();
153 
160  void hide();
161 
162  protected:
163  bool eventFilter(QObject *object, QEvent *e) override;
164  virtual void contextMenuEvent ( QWidget *w, QContextMenuEvent *e );
165  virtual void toolTipEvent( QHelpEvent *e );
166  QMenu* contextMenu();
167 
168  private:
169  Q_DISABLE_COPY( AbstractFloatItem )
170  AbstractFloatItemPrivate * const d;
171 };
172 
173 }
174 
175 #endif
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:93
Binds a QML item to a specific geodetic location in screen coordinates.
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
The abstract class for float item plugins.
A public class that controls what is visible in the viewport of a Marble map.
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:91
RenderType
A Type of plugin.
Definition: RenderPlugin.h:59
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 23:17:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.