本文整理汇总了C++中MarbleWidget::model方法的典型用法代码示例。如果您正苦于以下问题:C++ MarbleWidget::model方法的具体用法?C++ MarbleWidget::model怎么用?C++ MarbleWidget::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarbleWidget
的用法示例。
在下文中一共展示了MarbleWidget::model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(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();
}
示例3: if
Marble::MarbleModel * NavigationPrivate::model() const
{
if (m_marbleQuickItem != nullptr) {
return m_marbleQuickItem->model();
}
else if (m_marbleWidget != nullptr)
{
return m_marbleWidget->model();
}
return nullptr;
}
示例4: 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();
}