[英]Trying to add the result of a QGeoSearchReply to a maps::DataProvider in Blackberry 10 Cascades (C++, QT & QML)
I am trying to add the result of a QGeoSearchReply to a maps :: DataProvider, and have found a function called convertToGeoList at this site , and am trying to use it, but the documentation doesn't even tell me what class the function is part of - as the geo class itself doesn't seem to exist in Blackberry Cascades. 我试图将QGeoSearchReply的结果添加到maps :: DataProvider中,并在此站点上找到了一个名为convertToGeoList的函数,并试图使用它,但是文档甚至没有告诉我该函数属于哪个类-地理类本身在Blackberry Cascades中似乎并不存在。 Anyway - here is code I have come up with:
无论如何-这是我想出的代码:
void Mapper::mapSearchResults(QtMobilitySubset::QGeoSearchReply *reply)
{
disconnect(mapSearchManagerEngine_, SIGNAL(finished(QtMobilitySubset::QGeoSearchReply*)),
this, SLOT(mapSearchResults(QMobilitySubset::QGeoSearchReply*)));
maps :: DataProvider provider;
provider.add(bb :: platform::geo::convertToGeoList(reply->places()));
maps::MapData mapData;
mapData.addProvider(&provider);
mapView_->setMapData(&mapData);
}
But I end up with this error: error: 'convertToGeoList' is not a member of 'bb :: platform::geo'- 但我最终遇到此错误:错误:'convertToGeoList'不是'bb :: platform :: geo'的成员-
Could someone please clarify how to do this? 有人可以澄清一下该怎么做吗?
You are right: bb::platform::geo
is not a class. 您是对的:
bb::platform::geo
不是课程。 It's a namespace. 这是一个名称空间。 Regarding
convertToGeoList()
, it's defined in bb/platform/geo/geo_converters.hpp
. 关于
convertToGeoList()
,它在bb/platform/geo/geo_converters.hpp
。 Including it should fix your error: 包括它应该可以解决您的错误:
bb/platform/geo/geo_converters.hpp 106:BB_PLATFORM_GEO_EXPORT bb::platform::geo::GeoList convertToGeoList( const QList src ); 122:BB_PLATFORM_GEO_EXPORT bb::platform::geo::GeoList convertToGeoList( const QtMobilitySubset::QGeoSearchReply* src );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.