本文整理汇总了C++中GeoDataDocument::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoDataDocument::setVisible方法的具体用法?C++ GeoDataDocument::setVisible怎么用?C++ GeoDataDocument::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoDataDocument
的用法示例。
在下文中一共展示了GeoDataDocument::setVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: browseMapButtonClicked
void MainWindow::browseMapButtonClicked()
{
d->m_marbleWidget->setMapThemeId(QStringLiteral("earth/political/political.dgml"));
/**
* Now display the country names which
* were removed to initiate the game
*/
const GeoDataTreeModel *const treeModel = d->m_marbleWidget->model()->treeModel();
for ( int i = 0; i < treeModel->rowCount(); ++i ) {
QVariant const data = treeModel->data ( treeModel->index ( i, 0 ), MarblePlacemarkModel::ObjectPointerRole );
GeoDataObject *object = qvariant_cast<GeoDataObject*>( data );
Q_ASSERT_X( object, "MainWindow::browseMapButtonClicked",
"failed to get valid data from treeModel for GeoDataObject" );
if ( object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
GeoDataDocument *doc = static_cast<GeoDataDocument*>( object );
QFileInfo fileInfo( doc->fileName() );
QString fileName = fileInfo.fileName();
if (fileName == QLatin1String("boundaryplacemarks.cache")) {
doc->setVisible( true );
d->m_marbleWidget->model()->treeModel()->updateFeature( doc );
d->m_marbleWidget->setHighlightEnabled( true );
break;
}
}
}
}