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


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

本文整理汇总了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;
}
开发者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(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

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

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


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