当前位置: 首页>>代码示例>>C++>>正文


C++ MarbleWidget::setMapThemeId方法代码示例

本文整理汇总了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;
}
开发者ID:quannt24,项目名称:marble,代码行数:31,代码来源:TourWidget.cpp

示例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();
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:34,代码来源:main.cpp

示例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();
}
开发者ID:fgx,项目名称:fgx-marble,代码行数:26,代码来源:main.cpp

示例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();
}
开发者ID:KDE,项目名称:marble,代码行数:32,代码来源:main.cpp

示例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" ) );
}
开发者ID:KDE,项目名称:marble,代码行数:27,代码来源:MapWizard.cpp

示例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
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:18,代码来源:MarbleWidgetTest.cpp

示例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
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:9,代码来源:MarbleWidgetTest.cpp

示例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
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:12,代码来源:MarbleWidgetTest.cpp

示例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();
}
开发者ID:AndreiDuma,项目名称:marble,代码行数:36,代码来源:main.cpp


注:本文中的MarbleWidget::setMapThemeId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。