• 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
  • examples
  • cpp
  • map-properties
examples/cpp/map-properties/main.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 2012 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #include <QApplication>
12 
13 #include <marble/MarbleGlobal.h>
14 #include <marble/MarbleWidget.h>
15 #include <marble/AbstractFloatItem.h>
16 
17 using namespace Marble;
18 
19 int main(int argc, char** argv)
20 {
21  QApplication app(argc,argv);
22 
23  // Create a Marble QWidget without a parent
24  MarbleWidget *mapWidget = new MarbleWidget();
25 
26  // Load the OpenStreetMap map
27  mapWidget->setMapThemeId("earth/bluemarble/bluemarble.dgml");
28 
29  mapWidget->setProjection( Mercator );
30 
31  // Enable the cloud cover and enable the country borders
32  mapWidget->setShowClouds( true );
33  mapWidget->setShowBorders( true );
34 
35  // Hide the FloatItems: Compass and StatusBar
36  mapWidget->setShowOverviewMap(false);
37  mapWidget->setShowScaleBar(false);
38 
39  foreach ( AbstractFloatItem * floatItem, mapWidget->floatItems() )
40  if ( floatItem && floatItem->nameId() == "compass" ) {
41 
42  // Put the compass onto the left hand side
43  floatItem->setPosition( QPoint( 10, 10 ) );
44  // Make the content size of the compass smaller
45  floatItem->setContentSize( QSize( 50, 50 ) );
46  }
47 
48  mapWidget->resize( 400, 300 );
49  mapWidget->show();
50 
51  return app.exec();
52 }
AbstractFloatItem.h
Marble::MarbleWidget::setProjection
void setProjection(int projection)
Set the Projection used for the map.
Definition: MarbleWidget.cpp:702
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
main
int main(int argc, char **argv)
Definition: examples/cpp/map-properties/main.cpp:19
Marble::MarbleWidget::setMapThemeId
void setMapThemeId(const QString &maptheme)
Set a new map theme.
Definition: MarbleWidget.cpp:865
Marble::MarbleWidget::setShowBorders
void setShowBorders(bool visible)
Set whether the borders visible.
Definition: MarbleWidget.cpp:1030
Marble::Mercator
Mercator projection.
Definition: MarbleGlobal.h:47
Marble::MarbleWidget::setShowOverviewMap
void setShowOverviewMap(bool visible)
Set whether the overview map overlay is visible.
Definition: MarbleWidget.cpp:901
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:48
MarbleGlobal.h
Marble::RenderPlugin::nameId
QString nameId
Definition: RenderPlugin.h:48
Marble::ScreenGraphicsItem::setPosition
void setPosition(const QPointF &position)
Set the position of the ScreenGraphicsItem.
Definition: ScreenGraphicsItem.cpp:44
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::MarbleWidget::setShowClouds
void setShowClouds(bool visible)
Set whether the cloud cover is visible.
Definition: MarbleWidget.cpp:922
Marble::FrameGraphicsItem::setContentSize
void setContentSize(const QSizeF &size)
Sets the size of the content of the item.
Definition: FrameGraphicsItem.cpp:204
Marble::MarbleWidget::floatItems
QList< AbstractFloatItem * > floatItems() const
Returns a list of all FloatItems on the widget.
Definition: MarbleWidget.cpp:1290
Marble::MarbleWidget::setShowScaleBar
void setShowScaleBar(bool visible)
Set whether the scale bar overlay is visible.
Definition: MarbleWidget.cpp:908
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 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