QgsMapToolIdentifyFeature is not deprecated in QGIS 3
https://qgis.org/api/classQgsMapToolIdentifyFeature.html
self.iface.QgsMapToolIdentifyFeature(atriVector, f)
is not correct way,you need create a instance for QgsMapToolIdentifyFeature
and set map tool after.
I add a minimal example
from qgis.gui import QgsMapToolIdentifyFeature
from PyQt5.QtGui import QColor
def onFeatureIdentified(feature):
fid = feature.id()
print ("feature selected : " + str(fid))
layer = iface.activeLayer()
mc=iface.mapCanvas()
mapTool = QgsMapToolIdentifyFeature(mc)
mapTool.setLayer(layer)
mc.setMapTool(mapTool)
mapTool.featureIdentified.connect(onFeatureIdentified)
QgsMapToolIdentifyFeature()
?self.iface.QgsMapToolIdentifyFeature(atriVector, f)
where atriVector=vectorLayer and f=selectedFeatureQgsMapToolIdentifyFeature
is a signal, is it right? I am looking for a way to open the IdentifyFeature tool using the selected feature, but I haven't found the actual tool yet, there are these methods:self.iface.actionIdentify().trigger()
,self.iface.openFeatureForm(atriVector, f)
,self.iface.showAttributeTable(atriVector)
but non of them opens the actual tool used in the qgis interface