File indexing completed on 2024-05-12 15:31:33
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2008 Inge Wallin <inge@lysator.liu.se> 0004 // 0005 0006 0007 // Local 0008 #include "FITemplateFloatItem.h" 0009 0010 // Qt 0011 #include <QRect> 0012 #include <QColor> 0013 #include <QSvgRenderer> 0014 0015 // Marble 0016 #include "MarbleDebug.h" 0017 #include "MarbleDirs.h" 0018 #include "GeoPainter.h" 0019 #include "GeoDataCoordinates.h" 0020 #include "ViewportParams.h" 0021 0022 namespace Marble 0023 { 0024 0025 FITemplateFloatItem::FITemplateFloatItem ( const QPointF &point, 0026 const QSizeF &size ) 0027 : AbstractFloatItem( point, size ), 0028 m_compass(), 0029 m_polarity( 0 ) 0030 { 0031 m_svgobj = new QSvgRenderer(MarbleDirs::path(QStringLiteral("svg/compass.svg")), 0032 this ); 0033 } 0034 0035 FITemplateFloatItem::~FITemplateFloatItem () 0036 { 0037 delete m_svgobj; 0038 } 0039 0040 QStringList FITemplateFloatItem::backendTypes() const 0041 { 0042 return QStringList(QStringLiteral("FITemplate")); 0043 } 0044 0045 QString FITemplateFloatItem::name() const 0046 { 0047 return tr( "FITemplate" ); 0048 } 0049 0050 QString FITemplateFloatItem::guiString() const 0051 { 0052 return tr( "Float Item &Template" ); 0053 } 0054 0055 QString FITemplateFloatItem::nameId() const 0056 { 0057 return QStringLiteral("floatitemtemplate"); 0058 } 0059 0060 QString FITemplateFloatItem::description() const 0061 { 0062 return tr( "This is a template class for float items." ); 0063 } 0064 0065 QIcon FITemplateFloatItem::icon () const 0066 { 0067 return QIcon(); 0068 } 0069 0070 0071 void FITemplateFloatItem::initialize () 0072 { 0073 // Initialize your float item here 0074 } 0075 0076 bool FITemplateFloatItem::isInitialized () const 0077 { 0078 // Return whether your float item is initialized here. 0079 return true; 0080 } 0081 0082 QPainterPath FITemplateFloatItem::backgroundShape() const 0083 { 0084 // Return a QPainterPath here that contains the outer shape of 0085 // your float item. 0086 } 0087 0088 bool FITemplateFloatItem::needsUpdate( ViewportParams *viewport ) 0089 { 0090 // Return whether your float item needs to be redrawn. 0091 } 0092 0093 bool FITemplateFloatItem::renderFloatItem( GeoPainter *painter, 0094 ViewportParams *viewport, 0095 GeoSceneLayer *layer ) 0096 { 0097 // Here you should render your float item 0098 } 0099 0100 } 0101 0102 #include "moc_FITemplateFloatItem.cpp"