• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • templates
  • floatitem
FITemplateFloatItem.cpp
Go to the documentation of this file.
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 Inge Wallin <inge@lysator.liu.se>
9 //
10 
11 
12 // Local
13 #include "FITemplateFloatItem.h"
14 
15 // Qt
16 #include <QRect>
17 #include <QColor>
18 #include <QPixmap>
19 #include <QSvgRenderer>
20 
21 // Marble
22 #include "MarbleDebug.h"
23 #include "MarbleDirs.h"
24 #include "GeoPainter.h"
25 #include "GeoDataCoordinates.h"
26 #include "ViewportParams.h"
27 
28 namespace Marble
29 {
30 
31 FITemplateFloatItem::FITemplateFloatItem ( const QPointF &point,
32  const QSizeF &size )
33  : AbstractFloatItem( point, size ),
34  m_compass(),
35  m_polarity( 0 )
36 {
37  m_svgobj = new QSvgRenderer( MarbleDirs::path( "svg/compass.svg" ),
38  this );
39 }
40 
41 FITemplateFloatItem::~FITemplateFloatItem ()
42 {
43  delete m_svgobj;
44 }
45 
46 QStringList FITemplateFloatItem::backendTypes() const
47 {
48  return QStringList( "FITemplate" );
49 }
50 
51 QString FITemplateFloatItem::name() const
52 {
53  return tr( "FITemplate" );
54 }
55 
56 QString FITemplateFloatItem::guiString() const
57 {
58  return tr( "Float Item &Template" );
59 }
60 
61 QString FITemplateFloatItem::nameId() const
62 {
63  return QString( "compass" );
64 }
65 
66 QString FITemplateFloatItem::description() const
67 {
68  return tr( "This is a template class for float items." );
69 }
70 
71 QIcon FITemplateFloatItem::icon () const
72 {
73  return QIcon();
74 }
75 
76 
77 void FITemplateFloatItem::initialize ()
78 {
79  // Initialize your float item here
80 }
81 
82 bool FITemplateFloatItem::isInitialized () const
83 {
84  // Return whether your float item is initialized here.
85  return true;
86 }
87 
88 QPainterPath FITemplateFloatItem::backgroundShape() const
89 {
90  // Return a QPainterPath here that contains the outer shape of
91  // your float item.
92 }
93 
94 bool FITemplateFloatItem::needsUpdate( ViewportParams *viewport )
95 {
96  // Return whether your float item needs to be redrawn.
97 }
98 
99 bool FITemplateFloatItem::renderFloatItem( GeoPainter *painter,
100  ViewportParams *viewport,
101  GeoSceneLayer *layer )
102 {
103  // Here you should render your float item
104 }
105 
106 }
107 
108 Q_EXPORT_PLUGIN2(FITemplateFloatItem, Marble::FITemplateFloatItem )
109 
110 #include "FITemplateFloatItem.moc"
GeoDataCoordinates.h
Marble::FITemplateFloatItem::description
QString description() const
Returns a user description of the plugin.
Definition: FITemplateFloatItem.cpp:66
Marble::FITemplateFloatItem::FITemplateFloatItem
FITemplateFloatItem(const QPointF &point=QPointF(-1.0, 10.0), const QSizeF &size=QSizeF(75.0, 75.0))
Definition: FITemplateFloatItem.cpp:31
Marble::FITemplateFloatItem::isInitialized
bool isInitialized() const
Definition: FITemplateFloatItem.cpp:82
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:59
FITemplateFloatItem.h
Marble::FITemplateFloatItem::name
QString name() const
Returns the user-visible name of the plugin.
Definition: FITemplateFloatItem.cpp:51
Marble::FITemplateFloatItem::backendTypes
QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
Definition: FITemplateFloatItem.cpp:46
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::FITemplateFloatItem::backgroundShape
QPainterPath backgroundShape() const
Returns the shape of the background.
Definition: FITemplateFloatItem.cpp:88
QSvgRenderer
Marble::FITemplateFloatItem::~FITemplateFloatItem
~FITemplateFloatItem()
Definition: FITemplateFloatItem.cpp:41
Marble::FITemplateFloatItem
The class that creates a ...
Definition: FITemplateFloatItem.h:35
MarbleDebug.h
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QPointF
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
MarbleDirs.h
Marble::FITemplateFloatItem::initialize
void initialize()
Definition: FITemplateFloatItem.cpp:77
QString
GeoPainter.h
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::FITemplateFloatItem::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: FITemplateFloatItem.cpp:56
QPainterPath
Marble::FITemplateFloatItem::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: FITemplateFloatItem.cpp:61
Marble::FITemplateFloatItem::renderFloatItem
bool renderFloatItem(GeoPainter *painter, ViewportParams *viewport, GeoSceneLayer *layer=0)
Definition: FITemplateFloatItem.cpp:99
QSizeF
Marble::FITemplateFloatItem::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: FITemplateFloatItem.cpp:71
QIcon
Marble::FITemplateFloatItem::needsUpdate
bool needsUpdate(ViewportParams *viewport)
Definition: FITemplateFloatItem.cpp:94
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal