• 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
  • render
  • mapscale
MapScaleFloatItem.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 Torsten Rahn <tackat@kde.org>
9 // Copyright 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
10 //
11 
12 #include "MapScaleFloatItem.h"
13 
14 #include <QContextMenuEvent>
15 #include <QDebug>
16 #include <QHelpEvent>
17 #include <QRect>
18 #include <QPixmap>
19 #include <QApplication>
20 #include <QPainter>
21 #include <QPushButton>
22 #include <QMenu>
23 #include <QToolTip>
24 
25 #include "ui_MapScaleConfigWidget.h"
26 #include "MarbleDebug.h"
27 #include "MarbleGlobal.h"
28 #include "projections/AbstractProjection.h"
29 #include "MarbleLocale.h"
30 #include "MarbleModel.h"
31 #include "ViewportParams.h"
32 
33 namespace Marble
34 {
35 
36 MapScaleFloatItem::MapScaleFloatItem( const MarbleModel *marbleModel )
37  : AbstractFloatItem( marbleModel, QPointF( 10.5, -10.5 ), QSizeF( 0.0, 40.0 ) ),
38  m_configDialog(0),
39  m_radius(0),
40  m_target(QString()),
41  m_leftBarMargin(0),
42  m_rightBarMargin(0),
43  m_scaleBarWidth(0),
44  m_viewportWidth(0),
45  m_scaleBarHeight(5),
46  m_scaleBarDistance(0.0),
47  m_bestDivisor(0),
48  m_pixelInterval(0),
49  m_valueInterval(0),
50  m_scaleInitDone( false ),
51  m_showRatioScale( false ),
52  m_contextMenu( 0 ),
53  m_minimized(false),
54  m_widthScaleFactor(2)
55 {
56 #ifdef Q_WS_MAEMO_5
57  setPosition( QPointF( 220.0, 10.5 ) );
58 #endif // Q_WS_MAEMO_5
59 
60  m_minimizeAction = new QAction(tr("Minimize"), this);
61  m_minimizeAction->setCheckable(true);
62  m_minimizeAction->setChecked(m_minimized);
63  connect(m_minimizeAction, SIGNAL(triggered()), this, SLOT(toggleMinimized()));
64 }
65 
66 MapScaleFloatItem::~MapScaleFloatItem()
67 {
68 }
69 
70 QStringList MapScaleFloatItem::backendTypes() const
71 {
72  return QStringList( "mapscale" );
73 }
74 
75 QString MapScaleFloatItem::name() const
76 {
77  return tr("Scale Bar");
78 }
79 
80 QString MapScaleFloatItem::guiString() const
81 {
82  return tr("&Scale Bar");
83 }
84 
85 QString MapScaleFloatItem::nameId() const
86 {
87  return QString( "scalebar" );
88 }
89 
90 QString MapScaleFloatItem::version() const
91 {
92  return "1.1";
93 }
94 
95 QString MapScaleFloatItem::description() const
96 {
97  return tr("This is a float item that provides a map scale.");
98 }
99 
100 QString MapScaleFloatItem::copyrightYears() const
101 {
102  return "2008, 2010, 2012";
103 }
104 
105 QList<PluginAuthor> MapScaleFloatItem::pluginAuthors() const
106 {
107  return QList<PluginAuthor>()
108  << PluginAuthor( "Torsten Rahn", "tackat@kde.org", tr( "Original Developer" ) )
109  << PluginAuthor( "Khanh-Nhan Nguyen", "khanh.nhan@wpi.edu" )
110  << PluginAuthor( "Illya Kovalevskyy", "illya.kovalevskyy@gmail.com" );
111 }
112 
113 QIcon MapScaleFloatItem::icon () const
114 {
115  return QIcon(":/icons/scalebar.png");
116 }
117 
118 
119 void MapScaleFloatItem::initialize ()
120 {
121 }
122 
123 bool MapScaleFloatItem::isInitialized () const
124 {
125  return true;
126 }
127 
128 void MapScaleFloatItem::setProjection( const ViewportParams *viewport )
129 {
130  int viewportWidth = viewport->width();
131 
132  QString target = marbleModel()->planetId();
133 
134  if ( !( m_radius == viewport->radius()
135  && viewportWidth == m_viewportWidth
136  && m_target == target
137  && m_scaleInitDone ) )
138  {
139  int fontHeight = QFontMetrics( font() ).ascent();
140  if (m_showRatioScale) {
141  setContentSize( QSizeF( viewport->width() / m_widthScaleFactor,
142  fontHeight + 3 + m_scaleBarHeight + fontHeight + 7 ) );
143  } else {
144  setContentSize( QSizeF( viewport->width() / m_widthScaleFactor,
145  fontHeight + 3 + m_scaleBarHeight ) );
146  }
147 
148  m_leftBarMargin = QFontMetrics( font() ).boundingRect( "0" ).width() / 2;
149  m_rightBarMargin = QFontMetrics( font() ).boundingRect( "0000" ).width() / 2;
150 
151  m_scaleBarWidth = contentSize().width() - m_leftBarMargin - m_rightBarMargin;
152  m_viewportWidth = viewport->width();
153  m_radius = viewport->radius();
154  m_scaleInitDone = true;
155 
156  m_pixel2Length = marbleModel()->planetRadius() /
157  (qreal)(viewport->radius());
158 
159  if ( viewport->currentProjection()->surfaceType() == AbstractProjection::Cylindrical )
160  {
161  qreal centerLatitude = viewport->viewLatLonAltBox().center().latitude();
162  // For flat maps we calculate the length of the 90 deg section of the
163  // central latitude circle. For flat maps this distance matches
164  // the pixel based radius propertyy.
165  m_pixel2Length *= M_PI / 2 * cos( centerLatitude );
166  }
167 
168  m_scaleBarDistance = (qreal)(m_scaleBarWidth) * m_pixel2Length;
169 
170  const MarbleLocale::MeasurementSystem measurementSystem =
171  MarbleGlobal::getInstance()->locale()->measurementSystem();
172 
173  if ( measurementSystem != MarbleLocale::MetricSystem ) {
174  m_scaleBarDistance *= KM2MI;
175  } else if (measurementSystem == MarbleLocale::NauticalSystem) {
176  m_scaleBarDistance *= KM2NM;
177  }
178 
179  calcScaleBar();
180 
181  update();
182  }
183 
184  AbstractFloatItem::setProjection( viewport );
185 }
186 
187 void MapScaleFloatItem::paintContent( QPainter *painter )
188 {
189  painter->save();
190 
191  painter->setRenderHint( QPainter::Antialiasing, true );
192 
193  int fontHeight = QFontMetrics( font() ).ascent();
194 
195  //calculate scale ratio
196  qreal displayMMPerPixel = 1.0 * painter->device()->widthMM() / painter->device()->width();
197  qreal ratio = m_pixel2Length / (displayMMPerPixel * MM2M);
198 
199  //round ratio to 3 most significant digits, assume that ratio >= 1, otherwise it may display "1 : 0"
200  //i made this assumption because as the primary use case we do not need to zoom in that much
201  qreal power = 1;
202  int iRatio = (int)(ratio + 0.5); //round ratio to the nearest integer
203  while (iRatio >= 1000) {
204  iRatio /= 10;
205  power *= 10;
206  }
207  iRatio *= power;
208  m_ratioString.setNum(iRatio);
209  m_ratioString = m_ratioString = "1 : " + m_ratioString;
210 
211  painter->setPen( QColor( Qt::darkGray ) );
212  painter->setBrush( QColor( Qt::darkGray ) );
213  painter->drawRect( m_leftBarMargin, fontHeight + 3,
214  m_scaleBarWidth,
215  m_scaleBarHeight );
216 
217  painter->setPen( QColor( Qt::black ) );
218  painter->setBrush( QColor( Qt::white ) );
219  painter->drawRect( m_leftBarMargin, fontHeight + 3,
220  m_bestDivisor * m_pixelInterval, m_scaleBarHeight );
221 
222  painter->setPen( QColor( Oxygen::aluminumGray4 ) );
223  painter->drawLine( m_leftBarMargin + 1, fontHeight + 2 + m_scaleBarHeight,
224  m_leftBarMargin + m_bestDivisor * m_pixelInterval - 1, fontHeight + 2 + m_scaleBarHeight );
225  painter->setPen( QColor( Qt::black ) );
226 
227  painter->setBrush( QColor( Qt::black ) );
228 
229  QString intervalStr;
230  int lastStringEnds = 0;
231  int currentStringBegin = 0;
232 
233  for ( int j = 0; j <= m_bestDivisor; j += 2 ) {
234  if ( j < m_bestDivisor ) {
235  painter->drawRect( m_leftBarMargin + j * m_pixelInterval,
236  fontHeight + 3, m_pixelInterval - 1,
237  m_scaleBarHeight );
238 
239  painter->setPen( QColor( Oxygen::aluminumGray5 ) );
240  painter->drawLine( m_leftBarMargin + j * m_pixelInterval + 1, fontHeight + 4,
241  m_leftBarMargin + (j + 1) * m_pixelInterval - 1, fontHeight + 4 );
242  painter->setPen( QColor( Qt::black ) );
243  }
244 
245  MarbleLocale::MeasurementSystem distanceUnit;
246  distanceUnit = MarbleGlobal::getInstance()->locale()->measurementSystem();
247 
248  QString unit = tr("km");
249  switch ( distanceUnit ) {
250  case MarbleLocale::MetricSystem:
251  if ( m_bestDivisor * m_valueInterval > 10000 ) {
252  unit = tr("km");
253  intervalStr.setNum( j * m_valueInterval / 1000 );
254  }
255  else {
256  unit = tr("m");
257  intervalStr.setNum( j * m_valueInterval );
258  }
259  break;
260  case MarbleLocale::ImperialSystem:
261  unit = tr("mi");
262  intervalStr.setNum( j * m_valueInterval / 1000 );
263 
264  if ( m_bestDivisor * m_valueInterval > 3800 ) {
265  intervalStr.setNum( j * m_valueInterval / 1000 );
266  }
267  else {
268  intervalStr.setNum( qreal(j * m_valueInterval ) / 1000.0, 'f', 2 );
269  }
270  break;
271  case MarbleLocale::NauticalSystem:
272  unit = tr("nm");
273  intervalStr.setNum( j * m_valueInterval / 1000 );
274 
275  if ( m_bestDivisor * m_valueInterval > 3800 ) {
276  intervalStr.setNum( j * m_valueInterval / 1000 );
277  }
278  else {
279  intervalStr.setNum( qreal(j * m_valueInterval ) / 1000.0, 'f', 2 );
280  }
281  break;
282  }
283 
284  painter->setFont( font() );
285 
286  if ( j == 0 ) {
287  painter->drawText( 0, fontHeight, "0 " + unit );
288  lastStringEnds = QFontMetrics( font() ).width( "0 " + unit );
289  continue;
290  }
291 
292  if( j == m_bestDivisor ) {
293  currentStringBegin = ( j * m_pixelInterval
294  - QFontMetrics( font() ).boundingRect( intervalStr ).width() );
295  }
296  else {
297  currentStringBegin = ( j * m_pixelInterval
298  - QFontMetrics( font() ).width( intervalStr ) / 2 );
299  }
300 
301  if ( lastStringEnds < currentStringBegin ) {
302  painter->drawText( currentStringBegin, fontHeight, intervalStr );
303  lastStringEnds = currentStringBegin + QFontMetrics( font() ).width( intervalStr );
304  }
305  }
306 
307  int leftRatioIndent = m_leftBarMargin + (m_scaleBarWidth - QFontMetrics( font() ).width(m_ratioString) ) / 2;
308  painter->drawText( leftRatioIndent, fontHeight + 3 + m_scaleBarHeight + fontHeight + 5, m_ratioString );
309 
310  painter->restore();
311 }
312 
313 void MapScaleFloatItem::calcScaleBar()
314 {
315  qreal magnitude = 1;
316 
317  // First we calculate the exact length of the whole area that is possibly
318  // available to the scalebar in kilometers
319  int magValue = (int)( m_scaleBarDistance );
320 
321  // We calculate the two most significant digits of the km-scalebar-length
322  // and store them in magValue.
323  while ( magValue >= 100 ) {
324  magValue /= 10;
325  magnitude *= 10;
326  }
327 
328  m_bestDivisor = 4;
329  int bestMagValue = 1;
330 
331  for ( int i = 0; i < magValue; i++ ) {
332  // We try to find the lowest divisor between 4 and 8 that
333  // divides magValue without remainder.
334  for ( int j = 4; j < 9; j++ ) {
335  if ( ( magValue - i ) % j == 0 ) {
336  // We store the very first result we find and store
337  // m_bestDivisor and bestMagValue as a final result.
338  m_bestDivisor = j;
339  bestMagValue = magValue - i;
340 
341  // Stop all for loops and end search
342  i = magValue;
343  j = 9;
344  }
345  }
346 
347  // If magValue doesn't divide through values between 4 and 8
348  // (e.g. because it's a prime number) try again with magValue
349  // decreased by i.
350  }
351 
352  m_pixelInterval = (int)( m_scaleBarWidth * (qreal)( bestMagValue )
353  / (qreal)( magValue ) / m_bestDivisor );
354  m_valueInterval = (int)( bestMagValue * magnitude / m_bestDivisor );
355 }
356 
357 QDialog *MapScaleFloatItem::configDialog()
358 {
359  if ( !m_configDialog ) {
360  // Initializing configuration dialog
361  m_configDialog = new QDialog();
362  ui_configWidget = new Ui::MapScaleConfigWidget;
363  ui_configWidget->setupUi( m_configDialog );
364 
365  readSettings();
366 
367  connect( ui_configWidget->m_buttonBox, SIGNAL(accepted()),
368  SLOT(writeSettings()) );
369  connect( ui_configWidget->m_buttonBox, SIGNAL(rejected()),
370  SLOT(readSettings()) );
371 
372  QPushButton *applyButton = ui_configWidget->m_buttonBox->button( QDialogButtonBox::Apply );
373  connect( applyButton, SIGNAL(clicked()) ,
374  this, SLOT(writeSettings()) );
375  }
376  return m_configDialog;
377 }
378 
379 void MapScaleFloatItem::contextMenuEvent( QWidget *w, QContextMenuEvent *e )
380 {
381  if ( !m_contextMenu ) {
382  m_contextMenu = contextMenu();
383 
384  foreach( QAction *action, m_contextMenu->actions() ) {
385  if ( action->text() == tr( "&Configure..." ) ) {
386  m_contextMenu->removeAction( action );
387  break;
388  }
389  }
390 
391  QAction *toggleAction = m_contextMenu->addAction( tr("&Ratio Scale"), this,
392  SLOT(toggleRatioScaleVisibility()) );
393  toggleAction->setCheckable( true );
394  toggleAction->setChecked( m_showRatioScale );
395 
396  m_contextMenu->addAction(m_minimizeAction);
397  }
398 
399  Q_ASSERT( m_contextMenu );
400  m_contextMenu->exec( w->mapToGlobal( e->pos() ) );
401 }
402 
403 void MapScaleFloatItem::toolTipEvent( QHelpEvent *e )
404 {
405  QToolTip::showText( e->globalPos(), m_ratioString );
406 }
407 
408 void MapScaleFloatItem::readSettings()
409 {
410  if ( !m_configDialog )
411  return;
412 
413  if ( m_showRatioScale ) {
414  ui_configWidget->m_showRatioScaleCheckBox->setCheckState( Qt::Checked );
415  } else {
416  ui_configWidget->m_showRatioScaleCheckBox->setCheckState( Qt::Unchecked );
417  }
418 
419  ui_configWidget->m_minimizeCheckBox->setChecked(m_minimized);
420 }
421 
422 void MapScaleFloatItem::writeSettings()
423 {
424  if ( ui_configWidget->m_showRatioScaleCheckBox->checkState() == Qt::Checked ) {
425  m_showRatioScale = true;
426  } else {
427  m_showRatioScale = false;
428  }
429 
430  if (m_minimized != ui_configWidget->m_minimizeCheckBox->isChecked()) {
431  toggleMinimized();
432  }
433 
434  emit settingsChanged( nameId() );
435 }
436 
437 void MapScaleFloatItem::toggleRatioScaleVisibility()
438 {
439  m_showRatioScale = !m_showRatioScale;
440  readSettings();
441  emit settingsChanged( nameId() );
442 }
443 
444 void MapScaleFloatItem::toggleMinimized()
445 {
446  m_minimized = !m_minimized;
447  ui_configWidget->m_minimizeCheckBox->setChecked(m_minimized);
448  m_minimizeAction->setChecked(m_minimized);
449  readSettings();
450  emit settingsChanged( nameId() );
451 
452  if (m_minimized == true) {
453  m_widthScaleFactor = 4;
454  } else {
455  m_widthScaleFactor = 2;
456  }
457 }
458 
459 }
460 
461 Q_EXPORT_PLUGIN2(MapScaleFloatItem, Marble::MapScaleFloatItem)
462 
463 #include "MapScaleFloatItem.moc"
QAction::text
text
Marble::MapScaleFloatItem::setProjection
void setProjection(const ViewportParams *viewport)
Definition: MapScaleFloatItem.cpp:128
QWidget
QFontMetrics::ascent
int ascent() const
Marble::MarbleLocale::NauticalSystem
Definition: MarbleLocale.h:40
Marble::MarbleLocale::measurementSystem
MarbleLocale::MeasurementSystem measurementSystem() const
Definition: MarbleLocale.cpp:45
QPainter::setRenderHint
void setRenderHint(RenderHint hint, bool on)
Marble::MM2M
const qreal MM2M
Definition: MarbleGlobal.h:216
Marble::MapScaleFloatItem::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: MapScaleFloatItem.cpp:85
QAction::setChecked
void setChecked(bool)
Marble::MapScaleFloatItem::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: MapScaleFloatItem.cpp:105
MarbleModel.h
This file contains the headers for MarbleModel.
MapScaleFloatItem.h
Marble::MapScaleFloatItem::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: MapScaleFloatItem.cpp:70
Marble::MarbleModel::planetId
QString planetId() const
Definition: MarbleModel.cpp:532
Marble::PluginAuthor
Definition: PluginInterface.h:28
QMenu::addAction
void addAction(QAction *action)
Marble::FrameGraphicsItem::contentSize
QSizeF contentSize() const
Returns the size of the content of the MarbleGraphicsItem.
Definition: FrameGraphicsItem.cpp:180
QWidget::mapToGlobal
QPoint mapToGlobal(const QPoint &pos) const
QPainter::save
void save()
Marble::ViewportParams::viewLatLonAltBox
const GeoDataLatLonAltBox & viewLatLonAltBox() const
Definition: ViewportParams.cpp:305
Marble::MapScaleFloatItem::name
QString name() const
Returns the user-visible name of the plugin.
Definition: MapScaleFloatItem.cpp:75
Marble::RenderPlugin::action
QAction * action() const
Plugin's menu action.
Definition: RenderPlugin.cpp:88
QFontMetrics
Marble::GeoDataCoordinates::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:751
QPainter::drawLine
void drawLine(const QLineF &line)
Marble::MapScaleFloatItem::copyrightYears
QString copyrightYears() const
Definition: MapScaleFloatItem.cpp:100
QToolTip::showText
void showText(const QPoint &pos, const QString &text, QWidget *w)
MarbleDebug.h
Marble::MarbleLocale::MeasurementSystem
MeasurementSystem
Definition: MarbleLocale.h:37
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
AbstractProjection.h
This file contains the headers for AbstractProjection.
Marble::MapScaleFloatItem::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: MapScaleFloatItem.cpp:357
QPointF
QPaintDevice::width
int width() const
Marble::MapScaleFloatItem::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: MapScaleFloatItem.cpp:80
QPainter::drawRect
void drawRect(const QRectF &rectangle)
QFontMetrics::boundingRect
QRect boundingRect(QChar ch) const
QPainter::setFont
void setFont(const QFont &font)
Marble::MapScaleFloatItem::~MapScaleFloatItem
~MapScaleFloatItem()
Definition: MapScaleFloatItem.cpp:66
Marble::ViewportParams::width
int width() const
Definition: ViewportParams.cpp:250
Marble::Oxygen::aluminumGray4
QColor const aluminumGray4
Definition: MarbleColors.h:92
Marble::MapScaleFloatItem::toolTipEvent
virtual void toolTipEvent(QHelpEvent *e)
Definition: MapScaleFloatItem.cpp:403
Marble::MapScaleFloatItem::MapScaleFloatItem
MapScaleFloatItem(const MarbleModel *marbleModel=0)
Definition: MapScaleFloatItem.cpp:36
QContextMenuEvent
QPainter::setPen
void setPen(const QColor &color)
Marble::RenderPlugin::settingsChanged
void settingsChanged(QString nameId)
This signal is emitted if the settings of the RenderPlugin changed.
QHelpEvent::globalPos
const QPoint & globalPos() const
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
QPainter
Marble::MapScaleFloatItem
The class that creates a map scale.
Definition: MapScaleFloatItem.h:32
QPaintDevice::widthMM
int widthMM() const
QPainter::device
QPaintDevice * device() const
Marble::MapScaleFloatItem::version
QString version() const
Definition: MapScaleFloatItem.cpp:90
QPainter::setBrush
void setBrush(const QBrush &brush)
QPainter::drawText
void drawText(const QPointF &position, const QString &text)
Marble::MarbleGlobal::locale
MarbleLocale * locale() const
Definition: MarbleGlobal.cpp:43
Marble::ViewportParams::currentProjection
const AbstractProjection * currentProjection() const
Definition: ViewportParams.cpp:134
QString
QList
QColor
Marble::MapScaleFloatItem::isInitialized
bool isInitialized() const
Definition: MapScaleFloatItem.cpp:123
MarbleLocale.h
MarbleGlobal.h
QMenu::exec
QAction * exec()
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::MapScaleFloatItem::initialize
void initialize()
Definition: MapScaleFloatItem.cpp:119
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
Marble::KM2MI
const qreal KM2MI
Definition: MarbleGlobal.h:203
Marble::GeoDataLatLonAltBox::center
virtual GeoDataCoordinates center() const
returns the center of this box
Definition: GeoDataLatLonAltBox.cpp:151
QFontMetrics::width
int width(const QString &text, int len) const
ViewportParams.h
This file contains the headers for ViewportParams.
QAction::setCheckable
void setCheckable(bool)
Marble::MarbleGlobal::getInstance
static MarbleGlobal * getInstance()
Definition: MarbleGlobal.cpp:37
Marble::AbstractProjection::Cylindrical
Definition: AbstractProjection.h:54
QPainter::restore
void restore()
Marble::MarbleLocale::MetricSystem
Definition: MarbleLocale.h:38
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
QContextMenuEvent::pos
const QPoint & pos() const
QRect::width
int width() const
QSizeF
Marble::Oxygen::aluminumGray5
QColor const aluminumGray5
Definition: MarbleColors.h:91
Marble::MapScaleFloatItem::contextMenuEvent
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: MapScaleFloatItem.cpp:379
Marble::ViewportParams::radius
int radius() const
Definition: ViewportParams.cpp:195
Marble::MapScaleFloatItem::description
QString description() const
Returns a user description of the plugin.
Definition: MapScaleFloatItem.cpp:95
QString::setNum
QString & setNum(short n, int base)
Marble::ScreenGraphicsItem::setPosition
void setPosition(const QPointF &position)
Set the position of the ScreenGraphicsItem.
Definition: ScreenGraphicsItem.cpp:44
QAction
QWidget::removeAction
void removeAction(QAction *action)
Marble::MarbleModel::planetRadius
qreal planetRadius() const
Definition: MarbleModel.cpp:522
M_PI
#define M_PI
Definition: GeoDataCoordinates.h:26
Marble::MarbleGraphicsItem::update
void update()
Marks the item and all parent items as invalid.
Definition: MarbleGraphicsItem.cpp:167
QDialog
Marble::AbstractFloatItem::font
QFont font() const
current font for rendering
Definition: AbstractFloatItem.cpp:109
QPushButton
Marble::MarbleLocale::ImperialSystem
Definition: MarbleLocale.h:39
Marble::KM2NM
const qreal KM2NM
Definition: MarbleGlobal.h:207
Marble::MapScaleFloatItem::paintContent
void paintContent(QPainter *painter)
Here the items paint their content.
Definition: MapScaleFloatItem.cpp:187
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:83
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QWidget::actions
QList< QAction * > actions() const
Marble::FrameGraphicsItem::setContentSize
void setContentSize(const QSizeF &size)
Sets the size of the content of the item.
Definition: FrameGraphicsItem.cpp:200
QHelpEvent
Marble::MapScaleFloatItem::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: MapScaleFloatItem.cpp:113
Marble::AbstractFloatItem::contextMenu
QMenu * contextMenu()
Definition: AbstractFloatItem.cpp:225
QSizeF::width
qreal width() const
QIcon
Marble::MarbleGraphicsItem::setProjection
virtual void setProjection(const ViewportParams *viewport)
Definition: MarbleGraphicsItem.cpp:272
Marble::AbstractProjection::surfaceType
virtual SurfaceType surfaceType() const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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