[QGIS Commit] r13016 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Mar 7 13:14:38 EST 2010
Author: jef
Date: 2010-03-07 13:14:35 -0500 (Sun, 07 Mar 2010)
New Revision: 13016
Modified:
trunk/qgis/src/app/qgsidentifyresults.cpp
Log:
fix #2516
Modified: trunk/qgis/src/app/qgsidentifyresults.cpp
===================================================================
--- trunk/qgis/src/app/qgsidentifyresults.cpp 2010-03-07 17:34:24 UTC (rev 13015)
+++ trunk/qgis/src/app/qgsidentifyresults.cpp 2010-03-07 18:14:35 UTC (rev 13016)
@@ -356,11 +356,16 @@
mActionPopup = new QMenu();
- mActionPopup->addAction( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ), this, SLOT( featureForm() ) );
- mActionPopup->addAction( tr( "Zoom to feature" ), this, SLOT( zoomToFeature() ) );
- mActionPopup->addAction( tr( "Copy attribute value" ), this, SLOT( copyAttributeValue() ) );
- mActionPopup->addAction( tr( "Copy feature attributes" ), this, SLOT( copyFeatureAttributes() ) );
- mActionPopup->addSeparator();
+ QTreeWidgetItem *featItem = featureItem( item );
+ if ( featItem )
+ {
+ mActionPopup->addAction( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ), this, SLOT( featureForm() ) );
+ mActionPopup->addAction( tr( "Zoom to feature" ), this, SLOT( zoomToFeature() ) );
+ mActionPopup->addAction( tr( "Copy attribute value" ), this, SLOT( copyAttributeValue() ) );
+ mActionPopup->addAction( tr( "Copy feature attributes" ), this, SLOT( copyFeatureAttributes() ) );
+ mActionPopup->addSeparator();
+ }
+
mActionPopup->addAction( tr( "Clear results" ), this, SLOT( clear() ) );
mActionPopup->addAction( tr( "Clear highlights" ), this, SLOT( clearRubberbands() ) );
mActionPopup->addAction( tr( "Highlight all" ), this, SLOT( highlightAll() ) );
@@ -558,6 +563,8 @@
QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item, QList< QPair<QString, QString> > &attributes, int &idx )
{
QTreeWidgetItem *featItem = featureItem( item );
+ if ( !featItem )
+ return 0;
idx = -1;
More information about the QGIS-commit
mailing list