[Marble-commits] KDE/kdeedu/marble/src/lib
Dennis Nienhüser
earthwings at gentoo.org
Mon Jan 17 21:38:25 CET 2011
SVN commit 1215152 by nienhueser:
Make feature name editable.
M +11 -1 GeoDataTreeModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/GeoDataTreeModel.cpp #1215151:1215152
@@ -385,7 +385,17 @@
emit dataChanged( index, index );
return true;
}
+ } else if ( role == Qt::EditRole ) {
+ if ( object->nodeType() == GeoDataTypes::GeoDataPlacemarkType
+ || object->nodeType() == GeoDataTypes::GeoDataFolderType
+ || object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
+ GeoDataFeature *feature = static_cast<GeoDataFeature*>( object );
+ feature->setName( value.toString() );
+ mDebug() << "setData " << feature->name() << " " << value.toString();
+ emit dataChanged( index, index );
+ return true;
}
+ }
return false;
}
@@ -399,7 +409,7 @@
if ( object->nodeType() == GeoDataTypes::GeoDataPlacemarkType
|| object->nodeType() == GeoDataTypes::GeoDataFolderType
|| object->nodeType() == GeoDataTypes::GeoDataDocumentType ) {
- return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
+ return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEditable;
}
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
More information about the Marble-commits
mailing list