KDE TechBase
  • Page
  • Discussion
  • Edit
  • History
KDE TechBase is a Wiki - You can help! Please contribute! Questions?
Please ask development related questions in the KDE Community Forum.

Development/Tutorials/MarbleWidget

< Development | Tutorials
Revision as of 02:15, 28 August 2008 by 96.237.252.219 (Talk)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Using MarbleWidget in your project.

This is a small HOWTO describing how I used Marble in my university project. Some facts: - The build environment I used was CMake - I used the latest Marble SVN version (because it had the latest features)

To be able to #include and to link Marble in your project, you have to add the Marble headers and library in your CMakeLists.txt file:

INCLUDE_DIRECTORIES(
...yourDirectories
/usr/local/include/marble) #or whatever the path to your Marble installation(!)
 
TARGET_LINK_LIBRARIES(yourProject ${QT_LIBRARIES}; marblewidget)

To actually use the widget, it's quite easy. I had a pointer

MarbleWidget *mwidget;

and used it like any other widget, e.g:

mwidget->show();
mwidget->moveLeft();

You can get the default theme (map) up and running as a widget with the following:

mwidget = new MarbleWidget;
mwidget->setMapThemeId("earth/srtm/srtm.dgml");

For a screenshot of what I did, see http://www.kdedevelopers.org/node/3206 (it's the one with the satellites) - thanks tackat. If you want to have to source of my project or want further information, drop a line and I'll gladly try to help: claudiu dot covaci at gmail dot com

Have fun!

Retrieved from "http://techbase.kde.org/Development/Tutorials/MarbleWidget"

Navigation

  • Home
  • Help
  • Recent changes

Sections

  • Getting started
  • Development
  • Schedules
  • Policies
  • Contribute
  • Projects

Toolbox

  • What links here
  • Related changes
  • Special pages
  • Printable version
  • Permanent link

Personal tools

  • 38.107.191.95
  • Talk for this IP
  • Log in / create account
  • Login with OpenID
Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal