• 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
  • kml-inspector
examples/cpp/kml-inspector/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 <QDebug>
12 #include <QFileInfo>
13 #include <QApplication>
14 #include <QTreeView>
15 
16 #include <marble/MarbleWidget.h>
17 #include <marble/MarbleModel.h>
18 #include <marble/ParsingRunnerManager.h>
19 #include <marble/GeoDataTreeModel.h>
20 
21 using namespace Marble;
22 
23 int main(int argc, char** argv)
24 {
25  QApplication app(argc,argv);
26 
27  QFileInfo inputFile( app.arguments().last() );
28  if ( app.arguments().size() < 2 || !inputFile.exists() ) {
29  qWarning() << "Usage: " << app.arguments().first() << "file.kml";
30  return 1;
31  }
32 
33  MarbleModel model;
34  ParsingRunnerManager manager( model.pluginManager() );
35 
36  GeoDataDocument* document = manager.openFile( inputFile.absoluteFilePath() );
37  if ( !document ) {
38  qDebug() << "Unable to open " << inputFile.absoluteFilePath();
39  return 2;
40  }
41 
42  GeoDataTreeModel treeModel;
43  treeModel.addDocument( document );
44 
45  QTreeView treeView;
46  treeView.setModel( &treeModel );
47  treeView.show();
48 
49  return app.exec();
50 }
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
Marble::GeoDataTreeModel
The representation of GeoData in a model This class represents all available data given by kml-data f...
Definition: GeoDataTreeModel.h:32
Marble::ParsingRunnerManager
Definition: ParsingRunnerManager.h:31
MarbleModel.h
This file contains the headers for MarbleModel.
main
int main(int argc, char **argv)
Definition: examples/cpp/kml-inspector/main.cpp:23
Marble::MarbleModel::pluginManager
const PluginManager * pluginManager() const
Definition: MarbleModel.cpp:564
Marble::GeoDataTreeModel::addDocument
int addDocument(GeoDataDocument *document)
Definition: GeoDataTreeModel.cpp:595
ParsingRunnerManager.h
GeoDataTreeModel.h
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
MarbleWidget.h
This file contains the headers for MarbleWidget.
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