本文整理汇总了C++中QgsFieldMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsFieldMap::end方法的具体用法?C++ QgsFieldMap::end怎么用?C++ QgsFieldMap::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsFieldMap
的用法示例。
在下文中一共展示了QgsFieldMap::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: columnBoxColumnId
int QgsAttributeTableDialog::columnBoxColumnId()
{
QgsFieldMap fieldMap = mLayer->pendingFields();
QgsFieldMap::Iterator it = fieldMap.begin();
for ( ; it != fieldMap.end(); ++it )
if ( it.value().name() == mColumnBox->currentText() )
return it.key();
return 0;
}
示例2: columnBoxInit
void QgsAttributeTableDialog::columnBoxInit()
{
QgsFieldMap fieldMap = mLayer->pendingFields();
QgsFieldMap::Iterator it = fieldMap.begin();
for ( ; it != fieldMap.end(); ++it )
if ( mLayer->editType( it.key() ) != QgsVectorLayer::Hidden )
mColumnBox->addItem( it.value().name() );
mColumnBox->setCurrentIndex( mColumnBox->findText( mLayer->displayField() ) );
}
示例3: addFeatureWithDefaultValue
int OptVectorLayer::addFeatureWithDefaultValue( OptFeature& f )
{
//{zhangliye2715:api}
if ( !isEditable() )
{
startEditing();
}
// add the fields to the QgsFeature
QgsVectorDataProvider* provider = dataProvider();
const QgsFieldMap fields = provider->fields();
for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); ++it )
{
f.addAttribute( it.key(), provider->defaultValue( it.key() ) );
}
int id = -1;
id = OptVectorLayer::addFeature( f );
if ( id != -1 )
{
//add points to other features to keep topology up-to-date
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if( topologicalEditing )
{
addTopologicalPoints( f.geometry() );
}
}
else
{
return -1;
}
//vlayer->setModified(true);
//commit or rollBack the change
if ( isModified() )
{
commitChanges();
}
else
{
rollBack();
return -1;
}
//make the layer still editable for the next adding operation
startEditing();
return id;
}
示例4: replaceWithCopyOf
void QgsClipboard::replaceWithCopyOf( const QgsFieldMap& fields, QgsFeatureList& features )
{
// Replace the QGis clipboard.
mFeatureClipboard = features;
QgsDebugMsg( "replaced QGis clipboard." );
// Replace the system clipboard.
QStringList textLines;
QStringList textFields;
// first do the field names
textFields += "wkt_geom";
for ( QgsFieldMap::const_iterator fit = fields.begin(); fit != fields.end(); ++fit )
{
textFields += fit->name();
}
textLines += textFields.join( "\t" );
textFields.clear();
// then the field contents
for ( QgsFeatureList::iterator it = features.begin(); it != features.end(); ++it )
{
QgsAttributeMap attributes = it->attributeMap();
// TODO: Set up Paste Transformations to specify the order in which fields are added.
if ( it->geometry() )
textFields += it->geometry()->exportToWkt();
else
{
QSettings settings;
textFields += settings.value( "qgis/nullValue", "NULL" ).toString();
}
// QgsDebugMsg("about to traverse fields.");
//
for ( QgsAttributeMap::iterator it2 = attributes.begin(); it2 != attributes.end(); ++it2 )
{
// QgsDebugMsg(QString("inspecting field '%1'.").arg(it2->toString()));
textFields += it2->toString();
}
textLines += textFields.join( "\t" );
textFields.clear();
}
QString textCopy = textLines.join( "\n" );
QClipboard *cb = QApplication::clipboard();
// Copy text into the clipboard
// With qgis running under Linux, but with a Windows based X
// server (Xwin32), ::Selection was necessary to get the data into
// the Windows clipboard (which seems contrary to the Qt
// docs). With a Linux X server, ::Clipboard was required.
// The simple solution was to put the text into both clipboards.
// The ::Selection setText() below one may need placing inside so
// #ifdef so that it doesn't get compiled under Windows.
cb->setText( textCopy, QClipboard::Selection );
cb->setText( textCopy, QClipboard::Clipboard );
QgsDebugMsg( QString( "replaced system clipboard with: %1." ).arg( textCopy ) );
}