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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • plugins
  • render
  • weather
WeatherItem.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 2009 Bastian Holst <bastianholst@gmx.de>
9 // Copyright 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
10 //
11 
12 // Self
13 #include "WeatherItem.h"
14 
15 // Marble
16 #include "GeoPainter.h"
17 #include "MarbleDirs.h"
18 #include "WeatherData.h"
19 #include "weatherGlobal.h"
20 #include "FrameGraphicsItem.h"
21 #include "LabelGraphicsItem.h"
22 #include "MarbleGraphicsGridLayout.h"
23 #include "WidgetGraphicsItem.h"
24 #include "TinyWebBrowser.h"
25 #include "MarbleDebug.h"
26 #include "MarbleWidget.h"
27 #include "layers/PopupLayer.h"
28 
29 // Qt
30 #include <QCoreApplication>
31 #include <QDate>
32 #include <QHash>
33 #include <QObject>
34 #include <QString>
35 #include <QAction>
36 #include <QBrush>
37 #include <QIcon>
38 #include <QFontMetrics>
39 #include <QPushButton>
40 #include <QSvgRenderer>
41 
42 namespace Marble
43 {
44 
45 const QSize borderSpacing( 4, 4 );
46 const QSize imageSize( 28, 28 );
47 const double imageSizeRatio = ( (double) imageSize.width()) / ( (double) imageSize.height() );
48 const qint32 horizontalSpacing = 4;
49 const qint32 verticalSpacing = 2;
50 
51 class WeatherItemPrivate
52 {
53  Q_DECLARE_TR_FUNCTIONS(WeatherItemPrivate)
54 
55  public:
56  WeatherItemPrivate( WeatherItem *parent )
57  : m_marbleWidget( 0 ),
58  m_priority( 0 ),
59  m_browserAction( tr( "Weather" ), parent ),
60  m_favoriteAction( parent ),
61  m_parent( parent ),
62  m_frameItem( m_parent ),
63  m_conditionLabel( &m_frameItem ),
64  m_temperatureLabel( &m_frameItem ),
65  m_windDirectionLabel( &m_frameItem ),
66  m_windSpeedLabel( &m_frameItem ),
67  m_favoriteButton( &m_frameItem )
68  {
69  // Setting minimum sizes
70  m_temperatureLabel.setMinimumSize( QSizeF( 0, imageSize.height() ) );
71  m_windSpeedLabel.setMinimumSize( QSizeF( 0, imageSize.height() ) );
72 
73  QPushButton *button = new QPushButton();
74  button->setStyleSheet( "border-style: outset;" );
75  button->setIcon( QIcon( ":/icons/bookmarks.png" ) );
76  button->setFixedSize( 22, 22 );
77  button->setFlat( true );
78  button->setCheckable( true );
79 
80  m_favoriteButton.setWidget( button );
81 
82  // Layouting the item
83  MarbleGraphicsGridLayout *topLayout = new MarbleGraphicsGridLayout( 1, 1 );
84  parent->setLayout( topLayout );
85  topLayout->addItem( &m_frameItem, 0, 0 );
86 
87  MarbleGraphicsGridLayout *gridLayout = new MarbleGraphicsGridLayout( 2, 3 );
88  gridLayout->setAlignment( Qt::AlignCenter );
89  gridLayout->setSpacing( 4 );
90  m_frameItem.setLayout( gridLayout );
91  m_frameItem.setFrame( FrameGraphicsItem::RoundedRectFrame );
92 
93  gridLayout->addItem( &m_conditionLabel, 0, 0 );
94  gridLayout->addItem( &m_temperatureLabel, 0, 1 );
95  gridLayout->setAlignment( &m_temperatureLabel, Qt::AlignRight | Qt::AlignVCenter );
96  gridLayout->addItem( &m_windDirectionLabel, 1, 0 );
97  gridLayout->addItem( &m_windSpeedLabel, 1, 1 );
98  gridLayout->setAlignment( &m_windSpeedLabel, Qt::AlignRight | Qt::AlignVCenter );
99  gridLayout->addItem( &m_favoriteButton, 0, 2 );
100 
101  updateLabels();
102  }
103 
104  ~WeatherItemPrivate()
105  {
106  }
107 
108  void updateToolTip()
109  {
110  QLocale locale = QLocale::system();
111  QString toolTip;
112  toolTip += tr( "Station: %1\n" ).arg( m_parent->stationName() );
113  if ( m_currentWeather.hasValidCondition() && m_currentWeather.hasValidTemperature() )
114  toolTip += QString( "%2, %3\n" ).arg( m_currentWeather.conditionString() )
115  .arg( temperatureString() );
116  else if ( m_currentWeather.hasValidCondition() )
117  toolTip += QString( "%2\n" ).arg( m_currentWeather.conditionString() );
118  else if ( m_currentWeather.hasValidTemperature() )
119  toolTip += QString( "%2\n" ).arg( temperatureString() );
120 
121  if ( m_currentWeather.hasValidWindSpeed() && m_currentWeather.hasValidWindDirection() )
122  toolTip += tr( "Wind: %4, %5\n", "Wind: WindSpeed, WindDirection" )
123  .arg( windSpeedString( ) )
124  .arg( m_currentWeather.windDirectionString() );
125  else if ( m_currentWeather.hasValidWindSpeed() )
126  toolTip += tr( "Wind: %4\n", "Wind: WindSpeed" )
127  .arg( m_currentWeather.windSpeedString() );
128  else if ( m_currentWeather.hasValidWindDirection() )
129  toolTip += tr( "Wind: %4\n", "Wind: WindDirection" )
130  .arg( m_currentWeather.windDirectionString() );
131 
132  if ( m_currentWeather.hasValidPressure() && m_currentWeather.hasValidPressureDevelopment() )
133  toolTip += tr( "Pressure: %6, %7", "Pressure: Pressure, Development" )
134  .arg( pressureString() )
135  .arg( m_currentWeather.pressureDevelopmentString() );
136  else if ( m_currentWeather.hasValidPressure() )
137  toolTip += tr( "Pressure: %6", "Pressure: Pressure" )
138  .arg( pressureString() );
139  else if ( m_currentWeather.hasValidPressureDevelopment() )
140  toolTip += tr( "Pressure %7", "Pressure Development" )
141  .arg( m_currentWeather.pressureDevelopmentString() );
142 
143  if ( !m_forecastWeather.isEmpty() ) {
144  toolTip += '\n';
145 
146  QDate minDate = QDate::currentDate();
147  minDate.addDays( -1 );
148  foreach( const WeatherData& data, m_forecastWeather ) {
149  QDate date = data.dataDate();
150  if( date >= minDate
151  && data.hasValidCondition()
152  && data.hasValidMinTemperature()
153  && data.hasValidMaxTemperature() )
154  {
155  toolTip += '\n';
156  toolTip += tr( "%1: %2, %3 to %4", "DayOfWeek: Condition, MinTemp to MaxTemp" )
157  .arg( locale.standaloneDayName( date.dayOfWeek() ) )
158  .arg( data.conditionString() )
159  .arg( data.minTemperatureString( temperatureUnit() ) )
160  .arg( data.maxTemperatureString( temperatureUnit() ) );
161  }
162  }
163  }
164 
165  m_parent->setToolTip( toolTip );
166  }
167 
168  void updateLabels()
169  {
170  if ( isConditionShown() ) {
171  m_conditionLabel.setImage( m_currentWeather.icon(), imageSize );
172  }
173  else {
174  m_conditionLabel.clear();
175  }
176 
177  if ( isTemperatureShown() ) {
178  m_temperatureLabel.setText( temperatureString() );
179  }
180  else {
181  m_temperatureLabel.clear();
182  }
183 
184  if ( isWindDirectionShown() ) {
185  QString windDirectionString = m_currentWeather.windDirectionString();
186  QSizeF windDirectionImageSize;
187  QSvgRenderer s_windIcons( MarbleDirs::path( "weather/wind-arrows.svgz" ) );
188  QSizeF windDirectionSizeF = s_windIcons.boundsOnElement( windDirectionString ).size();
189  double windDirectionRatio = windDirectionSizeF.width() / windDirectionSizeF.height();
190  if ( windDirectionRatio >= imageSizeRatio ) {
191  windDirectionImageSize.setWidth( imageSize.width() );
192  windDirectionImageSize.setHeight( imageSize.width() / windDirectionRatio );
193  }
194  else {
195  windDirectionImageSize.setHeight( imageSize.height() );
196  windDirectionImageSize.setWidth( imageSize.height() * windDirectionRatio );
197  }
198 
199  QImage windArrow( windDirectionImageSize.toSize(), QImage::Format_ARGB32 );
200  windArrow.fill( Qt::transparent );
201  QPainter painter( &windArrow );
202  s_windIcons.render( &painter, windDirectionString );
203  m_windDirectionLabel.setImage( windArrow );
204  }
205  else {
206  m_windDirectionLabel.clear();
207  }
208 
209  if ( isWindSpeedShown() ) {
210  m_windSpeedLabel.setText( windSpeedString() );
211  }
212  else {
213  m_windSpeedLabel.clear();
214  }
215 
216  m_parent->update();
217  }
218 
219  void updateFavorite()
220  {
221  QStringList items = m_settings.value( "favoriteItems" ).toString()
222  .split(QLatin1Char(','), QString::SkipEmptyParts);
223  bool favorite = items.contains( m_parent->id() );
224 
225  m_favoriteButton.setVisible( favorite );
226  m_favoriteAction.setText( favorite ? tr( "Remove from Favorites" )
227  : tr( "Add to Favorites" ) );
228 
229  if ( m_parent->isFavorite() != favorite ) {
230  m_parent->setFavorite( favorite );
231  }
232 
233  m_parent->update();
234  }
235 
236  bool isConditionShown()
237  {
238  return m_currentWeather.hasValidCondition()
239  && m_settings.value( "showCondition", showConditionDefault ).toBool();
240  }
241 
242  bool isTemperatureShown()
243  {
244  return m_currentWeather.hasValidTemperature()
245  && m_settings.value( "showTemperature", showTemperatureDefault ).toBool();
246  }
247 
248  bool isWindDirectionShown()
249  {
250  return m_currentWeather.hasValidWindDirection()
251  && m_settings.value( "showWindDirection", showWindDirectionDefault ).toBool();
252  }
253 
254  bool isWindSpeedShown()
255  {
256  return m_currentWeather.hasValidWindSpeed()
257  && m_settings.value( "showWindSpeed", showWindSpeedDefault ).toBool();
258  }
259 
260  QString temperatureString()
261  {
262  WeatherData::TemperatureUnit tUnit = temperatureUnit();
263  return m_currentWeather.temperatureString( tUnit );
264  }
265 
266  WeatherData::TemperatureUnit temperatureUnit()
267  {
268  WeatherData::TemperatureUnit tUnit
269  = (WeatherData::TemperatureUnit) m_settings.value( "temperatureUnit",
270  WeatherData::Celsius ).toInt();
271  return tUnit;
272  }
273 
274  QString windSpeedString()
275  {
276  return m_currentWeather.windSpeedString( speedUnit() );
277  }
278 
279  WeatherData::SpeedUnit speedUnit()
280  {
281  return (WeatherData::SpeedUnit) m_settings.value( "windSpeedUnit",
282  WeatherData::kph ).toInt();
283  }
284 
285  QString pressureString()
286  {
287  return m_currentWeather.pressureString( pressureUnit() );
288  }
289 
290  WeatherData::PressureUnit pressureUnit()
291  {
292  return (WeatherData::PressureUnit) m_settings.value( "pressureUnit",
293  WeatherData::HectoPascal ).toInt();
294  }
295 
296  MarbleWidget *m_marbleWidget;
297 
298  WeatherData m_currentWeather;
299  QMap<QDate, WeatherData> m_forecastWeather;
300 
301  int m_priority;
302  QAction m_browserAction;
303  QAction m_favoriteAction;
304  WeatherItem *m_parent;
305  QString m_stationName;
306  QHash<QString,QVariant> m_settings;
307 
308  static QFont s_font;
309 
310  // Labels and Layout
311  // We are not the owner of these items.
312  FrameGraphicsItem m_frameItem;
313  LabelGraphicsItem m_conditionLabel;
314  LabelGraphicsItem m_temperatureLabel;
315  LabelGraphicsItem m_windDirectionLabel;
316  LabelGraphicsItem m_windSpeedLabel;
317  WidgetGraphicsItem m_favoriteButton;
318 };
319 
320 // FIXME: Fonts to be defined globally
321 #ifdef Q_OS_MACX
322  QFont WeatherItemPrivate::s_font = QFont( "Sans Serif", 10 );
323 #else
324  QFont WeatherItemPrivate::s_font = QFont( "Sans Serif", 8 );
325 #endif
326 
327 WeatherItem::WeatherItem(QObject *parent )
328  : AbstractDataPluginItem( parent ),
329  d( new WeatherItemPrivate( this ) )
330 {
331  setCacheMode( ItemCoordinateCache );
332 }
333 
334 WeatherItem::WeatherItem(MarbleWidget* widget, QObject *parent )
335  : AbstractDataPluginItem( parent ),
336  d( new WeatherItemPrivate( this ) )
337 {
338  setCacheMode( ItemCoordinateCache );
339  d->m_marbleWidget = widget;
340 }
341 
342 WeatherItem::~WeatherItem()
343 {
344  delete d;
345 }
346 
347 QAction *WeatherItem::action()
348 {
349  disconnect( &d->m_browserAction, SIGNAL(triggered()),
350  this, SLOT(openBrowser()) );
351  connect( &d->m_browserAction, SIGNAL(triggered()),
352  this, SLOT(openBrowser()) );
353  return &d->m_browserAction;
354 }
355 
356 QString WeatherItem::itemType() const
357 {
358  return QString( "weatherItem" );
359 }
360 
361 bool WeatherItem::request( const QString& type )
362 {
363  Q_UNUSED( type )
364  return true;
365 }
366 
367 bool WeatherItem::initialized() const
368 {
369  return d->isConditionShown()
370  || d->isTemperatureShown()
371  || d->isWindDirectionShown()
372  || d->isWindSpeedShown();
373 }
374 
375 bool WeatherItem::operator<( const AbstractDataPluginItem *other ) const
376 {
377  const WeatherItem *weatherItem = qobject_cast<const WeatherItem *>(other);
378  if( weatherItem ) {
379  return ( priority() > weatherItem->priority() );
380  }
381  else {
382  return false;
383  }
384 }
385 
386 QString WeatherItem::stationName() const
387 {
388  return d->m_stationName;
389 }
390 
391 void WeatherItem::setStationName( const QString& name )
392 {
393  if ( name != d->m_stationName ) {
394  d->m_browserAction.setText( name );
395  d->m_stationName = name;
396  d->updateToolTip();
397  d->updateLabels();
398  emit stationNameChanged();
399  }
400 }
401 
402 WeatherData WeatherItem::currentWeather() const
403 {
404  return d->m_currentWeather;
405 }
406 
407 void WeatherItem::setCurrentWeather( const WeatherData &weather )
408 {
409  d->m_currentWeather = weather;
410  d->updateToolTip();
411  d->updateLabels();
412  emit updated();
413  emit descriptionChanged();
414  emit imageChanged();
415  emit temperatureChanged();
416 }
417 
418 QMap<QDate, WeatherData> WeatherItem::forecastWeather() const
419 {
420  return d->m_forecastWeather;
421 }
422 
423 void WeatherItem::setForecastWeather( const QMap<QDate, WeatherData>& forecasts )
424 {
425  d->m_forecastWeather = forecasts;
426 
427  d->updateToolTip();
428  emit updated();
429 }
430 
431 void WeatherItem::addForecastWeather( const QList<WeatherData>& forecasts )
432 {
433  foreach( const WeatherData& data, forecasts ) {
434  QDate date = data.dataDate();
435  WeatherData other = d->m_forecastWeather.value( date );
436  if ( !other.isValid() ) {
437  d->m_forecastWeather.insert( date, data );
438  }
439  else if ( other.publishingTime() < data.publishingTime() ) {
440  d->m_forecastWeather.remove( date );
441  d->m_forecastWeather.insert( date, data );
442  }
443  }
444 
445  // Remove old items
446  QDate minDate = QDate::currentDate();
447  minDate.addDays( -1 );
448 
449  QMap<QDate, WeatherData>::iterator it = d->m_forecastWeather.begin();
450 
451  while( it != d->m_forecastWeather.end() ) {
452  if ( it.key() < minDate ) {
453  d->m_forecastWeather.remove( it.key() );
454  }
455  it++;
456  }
457 
458  d->updateToolTip();
459  emit updated();
460 }
461 
462 quint8 WeatherItem::priority() const
463 {
464  return d->m_priority;
465 }
466 
467 void WeatherItem::setPriority( quint8 priority )
468 {
469  d->m_priority = priority;
470 }
471 
472 void WeatherItem::setSettings( const QHash<QString, QVariant>& settings )
473 {
474  if ( d->m_settings == settings ) {
475  return;
476  }
477 
478  d->m_settings = settings;
479 
480  d->updateToolTip();
481  d->updateLabels();
482  d->updateFavorite();
483 }
484 
485 void WeatherItem::setMarbleWidget(MarbleWidget *widget)
486 {
487  d->m_marbleWidget = widget;
488 }
489 
490 void WeatherItem::openBrowser()
491 {
492  if (d->m_marbleWidget) {
493  PopupLayer *popup = d->m_marbleWidget->popupLayer();
494  popup->setCoordinates( coordinate(), Qt::AlignRight | Qt::AlignVCenter );
495  popup->setSize( QSizeF( 610, 550 ) ); // +10 pixels for the width
496  popup->setVisible( true );
497 
498  QFile weatherHtmlFile(":/marble/weather/weather.html");
499  if ( !weatherHtmlFile.open(QIODevice::ReadOnly) ) {
500  return;
501  }
502 
503  QString templateHtml = weatherHtmlFile.readAll();
504  popup->setContent( createFromTemplate(templateHtml) );
505  }
506 }
507 
508 QString WeatherItem::createFromTemplate(const QString &templateHtml)
509 {
510  QString html = templateHtml;
511  QLocale locale = QLocale::system();
512  html.replace("%city_name%", stationName());
513  html.replace("%weather_situation%", "file://"+d->m_currentWeather.iconSource());
514  html.replace("%current_temp%", d->temperatureString());
515  html.replace("%current_condition%", d->m_currentWeather.conditionString());
516  html.replace("%wind_direction%", d->m_currentWeather.windDirectionString());
517  html.replace("%wind_speed%", d->m_currentWeather.windSpeedString());
518  html.replace("%humidity_level%", d->m_currentWeather.humidityString());
519  html.replace("%publish_time%", d->m_currentWeather.publishingTime().toString());
520 
521  if(d->m_forecastWeather.size() < 1) {
522  html.replace("%forecast_available%", "none");
523  } else {
524  html.replace("%forecast_available%", "block");
525  }
526 
527  int forecastNumber = 0;
528 
529  foreach ( const WeatherData &forecast, d->m_forecastWeather ) {
530  forecastNumber++;
531  const QString suffix = QString::number(forecastNumber);
532  QDate date = forecast.dataDate();
533  html.replace(QLatin1String("%day_f")+suffix+'%', locale.standaloneDayName(date.dayOfWeek()));
534  html.replace(QLatin1String("%weather_situation_f")+suffix+'%', "file://"+forecast.iconSource());
535  html.replace(QLatin1String("%max_temp_f")+suffix+'%',
536  forecast.maxTemperatureString(WeatherData::Celsius));
537  html.replace(QLatin1String("%min_temp_f")+suffix+'%',
538  forecast.minTemperatureString(WeatherData::Celsius));
539  html.replace(QLatin1String("%condition_f")+suffix+'%', forecast.conditionString());
540  html.replace(QLatin1String("%wind_direction_f")+suffix+'%', forecast.windDirectionString());
541  html.replace(QLatin1String("%wind_speed_f")+suffix+'%', forecast.windSpeedString());
542  html.replace(QLatin1String("%publish_time_f")+suffix+'%', forecast.publishingTime().toString());
543  }
544 
545  return html;
546 }
547 
548 QList<QAction*> WeatherItem::actions()
549 {
550  QList<QAction*> result;
551  result << &d->m_browserAction;
552 
553  disconnect( &d->m_favoriteAction, SIGNAL(triggered()),
554  this, SLOT(toggleFavorite()) );
555  connect( &d->m_favoriteAction, SIGNAL(triggered()),
556  this, SLOT(toggleFavorite()) );
557 
558  result << &d->m_favoriteAction;
559 
560  return result;
561 }
562 
563 QString WeatherItem::description() const
564 {
565  return d->m_currentWeather.toHtml( WeatherData::Celsius, WeatherData::kph, WeatherData::Bar );
566 }
567 
568 QString WeatherItem::image() const
569 {
570  return d->m_currentWeather.iconSource();
571 }
572 
573 double WeatherItem::temperature() const
574 {
575  return d->m_currentWeather.hasValidTemperature()
576  ? d->m_currentWeather.temperature( WeatherData::Celsius )
577  : 0.0;
578 }
579 
580 } // namespace Marble
581 
582 #include "WeatherItem.moc"
Marble::WeatherData::hasValidCondition
bool hasValidCondition() const
Definition: WeatherData.cpp:354
QPainter
Marble::WeatherItem::~WeatherItem
~WeatherItem()
Definition: WeatherItem.cpp:342
Marble::WeatherItem::stationNameChanged
void stationNameChanged()
Marble::FrameGraphicsItem
Definition: FrameGraphicsItem.h:25
TinyWebBrowser.h
Marble::WeatherItem::itemType
QString itemType() const
Returns the type of this specific item.
Definition: WeatherItem.cpp:356
LabelGraphicsItem.h
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:53
showWindDirectionDefault
const bool showWindDirectionDefault
Definition: weatherGlobal.h:18
showTemperatureDefault
const bool showTemperatureDefault
Definition: weatherGlobal.h:17
Marble::WeatherItem::operator<
bool operator<(const AbstractDataPluginItem *other) const
Definition: WeatherItem.cpp:375
Marble::AbstractDataPluginItem
Definition: AbstractDataPluginItem.h:28
Marble::WeatherItem::currentWeather
WeatherData currentWeather() const
Definition: WeatherItem.cpp:402
Marble::WeatherData::minTemperatureString
QString minTemperatureString(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:665
Marble::imageSizeRatio
const double imageSizeRatio
Definition: WeatherItem.cpp:47
Marble::WeatherData::publishingTime
QDateTime publishingTime() const
Get the time when the data was published.
Definition: WeatherData.cpp:311
Marble::PopupLayer
The PopupLayer class.
Definition: PopupLayer.h:39
Marble::WeatherItem::initialized
bool initialized() const
Definition: WeatherItem.cpp:367
Marble::WeatherData::PressureUnit
PressureUnit
Definition: WeatherData.h:115
Marble::WeatherItem::descriptionChanged
void descriptionChanged()
Marble::WeatherData::dataDate
QDate dataDate() const
Get the date the data is meant for.
Definition: WeatherData.cpp:327
Marble::MarbleGraphicsGridLayout::setAlignment
void setAlignment(Qt::Alignment align)
Definition: MarbleGraphicsGridLayout.cpp:194
Marble::MarbleGraphicsItem::setLayout
void setLayout(AbstractMarbleGraphicsLayout *layout)
Set the layout of the graphics item.
Definition: MarbleGraphicsItem.cpp:146
Marble::MarbleGraphicsGridLayout::addItem
void addItem(ScreenGraphicsItem *item, int row, int column)
Definition: MarbleGraphicsGridLayout.cpp:74
Marble::WeatherData::Bar
Definition: WeatherData.h:118
Marble::WeatherItem::forecastWeather
QMap< QDate, WeatherData > forecastWeather() const
Definition: WeatherItem.cpp:418
QObject
MarbleDebug.h
Marble::WeatherData::SpeedUnit
SpeedUnit
Definition: WeatherData.h:101
Marble::WeatherData::TemperatureUnit
TemperatureUnit
Definition: WeatherData.h:109
showWindSpeedDefault
const bool showWindSpeedDefault
Definition: weatherGlobal.h:19
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
FrameGraphicsItem.h
Marble::WeatherData
Definition: WeatherData.h:26
Marble::WeatherItem::imageChanged
void imageChanged()
Marble::WeatherData::isValid
bool isValid() const
Definition: WeatherData.cpp:295
Marble::MarbleGraphicsGridLayout::setSpacing
void setSpacing(int spacing)
Set the spacing between the items inside the layout.
Definition: MarbleGraphicsGridLayout.cpp:209
Marble::imageSize
const QSize imageSize(28, 28)
Marble::FrameGraphicsItem::RoundedRectFrame
Definition: FrameGraphicsItem.h:31
Marble::WeatherItem::actions
virtual QList< QAction * > actions()
Definition: WeatherItem.cpp:548
Marble::WeatherItem::setStationName
void setStationName(const QString &name)
Definition: WeatherItem.cpp:391
showConditionDefault
const bool showConditionDefault
Definition: weatherGlobal.h:16
Marble::WeatherItem::request
virtual bool request(const QString &type)
Test if the item wants to request type again.
Definition: WeatherItem.cpp:361
Marble::WeatherItem::priority
quint8 priority() const
Definition: WeatherItem.cpp:462
Marble::verticalSpacing
const qint32 verticalSpacing
Definition: WeatherItem.cpp:49
MarbleDirs.h
Marble::MarbleGraphicsItem::ItemCoordinateCache
Definition: MarbleGraphicsItem.h:41
Marble::WeatherItem::setForecastWeather
void setForecastWeather(const QMap< QDate, WeatherData > &forecasts)
Definition: WeatherItem.cpp:423
Marble::WeatherItem::addForecastWeather
void addForecastWeather(const QList< WeatherData > &forecasts)
Adds additional forecasts to the list.
Definition: WeatherItem.cpp:431
Marble::WeatherItem::setPriority
void setPriority(quint8 priority)
Definition: WeatherItem.cpp:467
Marble::PopupLayer::setContent
void setContent(const QString &html)
Sets content of the browser.
Definition: PopupLayer.cpp:108
Marble::MarbleGraphicsGridLayout
Definition: MarbleGraphicsGridLayout.h:27
Marble::WeatherData::Celsius
Definition: WeatherData.h:110
Marble::WeatherItem::WeatherItem
WeatherItem(QObject *parent=0)
Definition: WeatherItem.cpp:327
GeoPainter.h
Marble::WidgetGraphicsItem
Definition: WidgetGraphicsItem.h:28
WidgetGraphicsItem.h
Marble::WeatherItem::action
QAction * action()
Returns the action of this specific item.
Definition: WeatherItem.cpp:347
Marble::borderSpacing
const QSize borderSpacing(4, 4)
Marble::WeatherItem::stationName
QString stationName() const
Definition: WeatherItem.cpp:386
Marble::WeatherData::kph
Definition: WeatherData.h:102
weatherGlobal.h
Marble::WeatherData::maxTemperatureString
QString maxTemperatureString(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:649
MarbleGraphicsGridLayout.h
Marble::WeatherData::HectoPascal
Definition: WeatherData.h:116
Marble::PopupLayer::setVisible
void setVisible(bool visible)
Set visibility of the item.
Definition: PopupLayer.cpp:78
PopupLayer.h
Marble::WeatherData::hasValidMaxTemperature
bool hasValidMaxTemperature() const
Definition: WeatherData.cpp:655
Marble::MarbleGraphicsItem::setCacheMode
void setCacheMode(CacheMode mode)
Set the cache mode of the item.
Definition: MarbleGraphicsItem.cpp:159
Marble::WeatherItem::setSettings
void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the item.
Definition: WeatherItem.cpp:472
Marble::BillboardGraphicsItem::coordinate
GeoDataCoordinates coordinate() const
Definition: BillboardGraphicsItem.cpp:93
Marble::LabelGraphicsItem
A label item provides an Item that displays text or images/pixmaps.
Definition: LabelGraphicsItem.h:31
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::PopupLayer::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates, Qt::Alignment alignment)
Sets coordinates.
Definition: PopupLayer.cpp:97
Marble::WeatherItem::setMarbleWidget
void setMarbleWidget(MarbleWidget *widget)
Definition: WeatherItem.cpp:485
Marble::WeatherItem::description
QString description() const
Marble::WeatherItem::temperature
double temperature() const
Marble::WeatherItem::openBrowser
void openBrowser()
Definition: WeatherItem.cpp:490
Marble::AbstractDataPluginItem::toggleFavorite
void toggleFavorite()
Definition: AbstractDataPluginItem.cpp:117
Marble::PopupLayer::setSize
void setSize(const QSizeF &size)
Sets size of popup item.
Definition: PopupLayer.cpp:128
WeatherData.h
Marble::WeatherItem
This is the class painting a weather item on the screen.
Definition: WeatherItem.h:37
Marble::WeatherData::conditionString
QString conditionString() const
Definition: WeatherData.cpp:359
Marble::horizontalSpacing
const qint32 horizontalSpacing
Definition: WeatherItem.cpp:48
Marble::WeatherData::hasValidMinTemperature
bool hasValidMinTemperature() const
Definition: WeatherData.cpp:677
WeatherItem.h
Marble::WeatherItem::temperatureChanged
void temperatureChanged()
Marble::WeatherItem::image
QString image() const
Marble::AbstractDataPluginItem::updated
void updated()
Marble::WeatherItem::setCurrentWeather
void setCurrentWeather(const WeatherData &weather)
Definition: WeatherItem.cpp:407
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:53 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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