Creating a window with controls

We'd like to add other widgets to our Marble window: A zoom slider and a label that shows the current mouse position.

In order to achieve this we need to create a vertical layout. Once done we add the slider and the label that we created to the layout. Also we zoom the globe to the slider's default value using the MarbleWidget::zoomView(int) method.

We want to center our globe onto a place that is different from the default. So we create a new GeoDataCoordinates object that takes the longitude and the latitude as a parameter. In the next step MarbleWidget::centerOn is called.

include <QtGui/QApplication>

include <QtGui/QLayout>

include <QtGui/QSlider>

include <QtGui/QLabel>

include <marble/MarbleWidget.h>

using namespace Marble;

int main(int argc, char** argv)
{

QApplication app(argc,argv);
QWidget *window = new QWidget;

// Create a Marble QWidget without a parent
MarbleWidget *mapWidget = new MarbleWidget();