本文整理汇总了C++中MarbleWidget::setMapThemeId方法的典型用法代码示例。如果您正苦于以下问题:C++ MarbleWidget::setMapThemeId方法的具体用法?C++ MarbleWidget::setMapThemeId怎么用?C++ MarbleWidget::setMapThemeId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarbleWidget
的用法示例。
在下文中一共展示了MarbleWidget::setMapThemeId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: captureTour
void TourWidgetPrivate::captureTour()
{
MarbleWidget* widget = new MarbleWidget;
widget->setMapThemeId( m_widget->mapThemeId() );
widget->resize( 1280, 720 );
m_widget->model()->treeModel()->removeDocument(m_document);
widget->model()->treeModel()->addDocument(m_document);
GeoDataTour* tour = findTour( m_document );
TourPlayback* playback = new TourPlayback;
playback->setMarbleWidget( widget );
playback->setTour( tour );
m_tourUi.m_listView->setModel( widget->model()->treeModel() );
if( tour ){
m_tourUi.m_listView->setRootIndex( widget->model()->treeModel()->index( tour->playlist() ) );
m_tourUi.m_listView->repaint();
TourCaptureDialog* tourCaptureDialog = new TourCaptureDialog( widget, m_widget );
tourCaptureDialog->setDefaultFilename( tour->name() );
tourCaptureDialog->setTourPlayback( playback );
tourCaptureDialog->exec();
}
delete playback;
widget->model()->treeModel()->removeDocument(m_document);
m_widget->model()->treeModel()->addDocument(m_document);
updateRootIndex();
delete widget;
}
示例2: main
int main(int argc, char** argv)
{
QApplication app(argc,argv);
// Create a Marble QWidget without a parent
MarbleWidget *mapWidget = new MarbleWidget();
// Load the OpenStreetMap map
mapWidget->setMapThemeId("earth/bluemarble/bluemarble.dgml");
mapWidget->setProjection( Mercator );
// Enable the cloud cover and enable the country borders
mapWidget->setShowClouds( true );
mapWidget->setShowBorders( true );
// Hide the FloatItems: Compass and StatusBar
mapWidget->setShowOverviewMap(false);
mapWidget->setShowScaleBar(false);
foreach ( AbstractFloatItem * floatItem, mapWidget->floatItems() )
if ( floatItem && floatItem->nameId() == "compass" ) {
// Put the compass onto the left hand side
floatItem->setPosition( QPoint( 10, 10 ) );
// Make the content size of the compass smaller
floatItem->setContentSize( QSize( 50, 50 ) );
}
mapWidget->resize( 400, 300 );
mapWidget->show();
return app.exec();
}
示例3: main
int main(int argc, char** argv)
{
QApplication app(argc,argv);
MarbleWidget *mapWidget = new MarbleWidget;
// Create and register our paint layer
MyPaintLayer* layer = new MyPaintLayer(mapWidget);
// Uncomment for older versions of Marble:
// mapWidget->map()->model()->addLayer(layer);
mapWidget->addLayer(layer);
// Install an event handler: Pressing + will change the layer we paint at
mapWidget->installEventFilter(layer);
// Finish widget creation.
mapWidget->setMapThemeId("earth/bluemarble/bluemarble.dgml");
mapWidget->show();
// Update each second to give the clock second resolution
QTimer seconds;
seconds.setInterval(1000);
QObject::connect(&seconds, SIGNAL(timeout()), mapWidget, SLOT(update()));
seconds.start();
return app.exec();
}
示例4: main
int main(int argc, char** argv)
{
QApplication app(argc,argv);
// Create a Marble QWidget without a parent
MarbleWidget *mapWidget = new MarbleWidget();
// Load the OpenStreetMap map
mapWidget->setMapThemeId(QStringLiteral("earth/openstreetmap/openstreetmap.dgml"));
mapWidget->setProjection( Mercator );
// Access the shared route request (start, destination and parameters)
RoutingManager* manager = mapWidget->model()->routingManager();
RouteRequest* request = manager->routeRequest();
// Use default routing settings for cars
request->setRoutingProfile( manager->defaultProfile( RoutingProfile::Motorcar ) );
// Set start and destination
request->append( GeoDataCoordinates( 8.38942, 48.99738, 0.0, GeoDataCoordinates::Degree ) );
request->append( GeoDataCoordinates( 8.42002, 49.0058, 0.0, GeoDataCoordinates::Degree ) );
// Calculate the route
manager->retrieveRoute();
// Center the map on the route start point and show it
mapWidget->centerOn( request->at( 0 ) );
mapWidget->setDistance( 0.75 );
mapWidget->show();
return app.exec();
}
示例5: QDialog
PreviewDialog::PreviewDialog( QWidget* parent, const QString& mapThemeId ) : QDialog( parent ), m_mapThemeId( mapThemeId )
{
QGridLayout *layout = new QGridLayout();
MarbleWidget *widget = new MarbleWidget();
MarbleNavigator *navigator = new MarbleNavigator();
connect( navigator, SIGNAL(goHome()), widget, SLOT(goHome()) );
connect( navigator, SIGNAL(moveUp()), widget, SLOT(moveUp()) );
connect( navigator, SIGNAL(moveDown()), widget, SLOT(moveDown()) );
connect( navigator, SIGNAL(moveLeft()), widget, SLOT(moveLeft()) );
connect( navigator, SIGNAL(moveRight()), widget, SLOT(moveRight()) );
connect( navigator, SIGNAL(zoomIn()), widget, SLOT(zoomIn()) );
connect( navigator, SIGNAL(zoomOut()), widget, SLOT(zoomOut()) );
connect( navigator, SIGNAL(zoomChanged(int)), widget, SLOT(setZoom(int)) );
widget->setMapThemeId( m_mapThemeId );
widget->setZoom( 1000 );
layout->addWidget( navigator, 1, 1 );
layout->addWidget( widget, 1, 2 );
layout->setMargin( 0 );
layout->setSpacing( 0 );
this->setLayout( layout );
this->setMinimumSize( 640, 480 );
this->setWindowTitle( tr( "Preview Map" ) );
}
示例6: switchMapThemes
void MarbleWidgetTest::switchMapThemes()
{
MarbleWidget widget;
widget.setMapThemeId( "earth/plain/plain.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/plain/plain.dgml" ) );
widget.setMapThemeId( "earth/srtm/srtm.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/srtm/srtm.dgml" ) );
widget.setMapThemeId( "earth/openstreetmap/openstreetmap.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/openstreetmap/openstreetmap.dgml" ) );
widget.setMapThemeId( "earth/plain/plain.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/plain/plain.dgml" ) );
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
示例7: mouseMove
void MarbleWidgetTest::mouseMove()
{
MarbleWidget widget;
widget.setMapThemeId("earth/srtm/srtm.dgml");
QTest::mouseMove( &widget );
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
示例8: setMapTheme
void MarbleWidgetTest::setMapTheme()
{
QFETCH( QString, mapThemeId );
MarbleWidget widget;
widget.setMapThemeId( mapThemeId );
QCOMPARE( widget.mapThemeId(), mapThemeId );
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
示例9: main
int main(int argc, char** argv) {
QApplication app(argc,argv);
QFileInfo inputFile( app.arguments().last() );
if ( app.arguments().size() < 2 || !inputFile.exists() ) {
qWarning() << "Usage: " << app.arguments().first() << "file.png";
return 1;
}
// Create a Marble QWidget without a parent
MarbleWidget *mapWidget = new MarbleWidget();
// Load the Satellite map
mapWidget->setMapThemeId( "earth/bluemarble/bluemarble.dgml" );
// Create a bounding box from the given corner points
GeoDataLatLonBox box( 55, 48, 14.5, 6, GeoDataCoordinates::Degree );
box.setRotation( 0, GeoDataCoordinates::Degree );
// Create an overlay and assign the image to render and its bounding box to it
GeoDataGroundOverlay *overlay = new GeoDataGroundOverlay;
overlay->setLatLonBox( box );
overlay->setIcon( QImage( inputFile.absoluteFilePath() ) );
// Create a document as a container for the overlay
GeoDataDocument *document = new GeoDataDocument();
document->append( overlay );
// Add the document to MarbleWidget's tree model
mapWidget->model()->treeModel()->addDocument( document );
mapWidget->show();
return app.exec();
}