本文整理汇总了C++中GeoDataDocument::setTargetId方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoDataDocument::setTargetId方法的具体用法?C++ GeoDataDocument::setTargetId怎么用?C++ GeoDataDocument::setTargetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoDataDocument
的用法示例。
在下文中一共展示了GeoDataDocument::setTargetId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPlacemark
void TourWidgetPrivate::addPlacemark()
{
// Get the normalized coordinates of the focus point. There will be automatically added a new
// placemark.
qreal lat = m_widget->focusPoint().latitude();
qreal lon = m_widget->focusPoint().longitude();
GeoDataCoordinates::normalizeLonLat( lon, lat );
GeoDataDocument *document = new GeoDataDocument;
if( m_document->id().isEmpty() ) {
if( m_document->name().isEmpty() ) {
m_document->setId( "untitled_tour" );
} else {
m_document->setId( m_document->name().trimmed().replace( " ", "_" ).toLower() );
}
}
document->setTargetId( m_document->id() );
GeoDataPlacemark *placemark = new GeoDataPlacemark;
placemark->setCoordinate( lon, lat );
placemark->setVisible( true );
placemark->setBalloonVisible( true );
GeoDataStyle *newStyle = new GeoDataStyle( *placemark->style() );
newStyle->iconStyle().setIcon( QImage() );
newStyle->iconStyle().setIconPath( MarbleDirs::path("bitmaps/redflag_22.png") );
placemark->setStyle( newStyle );
document->append( placemark );
GeoDataCreate *create = new GeoDataCreate;
create->append( document );
GeoDataUpdate *update = new GeoDataUpdate;
update->setCreate( create );
GeoDataAnimatedUpdate *animatedUpdate = new GeoDataAnimatedUpdate;
animatedUpdate->setUpdate( update );
if( m_delegate->editAnimatedUpdate( animatedUpdate ) ) {
addTourPrimitive( animatedUpdate );
m_delegate->setDefaultFeatureId( placemark->id() );
} else {
delete animatedUpdate;
}
}