I m New to Qt, and I m seeking to show the Ovimap.
不幸的是,我的方案刚刚失败。 我的守则是:
MapView::MapView(QWidget *parent, const char *name) {
mappingManager = 0;
QGeoServiceProvider *serviceProvider = new QGeoServiceProvider("nokia");
// QGeoSearchManager *searchManager = 0;
// QGeoServiceProvider serviceProvider("nokia");
//QGeoRoutingManager *routingManager = 0;
//routingManager = serviceProvider.routingManager();
if (serviceProvider->error() == QGeoServiceProvider::NoError) {
mappingManager = serviceProvider->mappingManager();
// searchManager = serviceProvider.searchManager();
QGraphicsScene *scene = new QGraphicsScene(this);
QGraphicsView *view = new QGraphicsView(scene, this);
mapGraphics = new QGraphicsGeoMap(mappingManager);
mapGraphics->setMapType(QGraphicsGeoMap::StreetMap);
mapGraphics->setConnectivityMode(QGraphicsGeoMap::HybridMode);
// scene->addText("Map view");
scene->addItem(mapGraphics);
view->show();
} else {
QMessageBox::information(this, "Map", "Service provider error");
}
}
我先谈一下我认为造成坠机的线——现场和场面;DaddItem(地形图);
How should I add the mapGraphics so I can see it on screen? I d really appreciate a hand with this.
提前感谢,J