<div dir="ltr"><div dir="ltr">Hi all,<div>I'm developing a plugin and I need to check if some features of the input vector layer are selected or not. If not I'd like to show an error message without closing the plugin gui:</div><div><br></div><div>This is the code at the moment:</div><div><br></div><div><div>            if self.dlg.checkBox.isChecked():</div><div>                check_sel = selectedLayer2.selectedFeatureCount()</div><div>                if check_sel > 0:</div><div>                    intersec_layer = QgsProcessingFeatureSourceDefinition(selectedLayer2.id(), True)</div><div>                else:</div><div>                    self.iface.messageBar().pushCritical("Error", "No features selected in layer {}.".format(selectedLayer2.name()))</div><div>                    return </div></div><div><br></div><div>Any idea?</div><div><br></div><div>Thanks</div><div>Roberta</div></div></div>