Estoy intentando comprobar si mi widget ya está abierto/visible antes de mostrarlo (o antes de ejecutar esta función). Necesito comprobar esto porque en mi plugin de QGIS puede ocurrir que llame a esta función muchas veces. He probado isVisible()
pero este código devuelve siempre falso. ¿Cómo hacer esta comprobación?
def run(self):
self.dlg = Dialog()
if self.dlg.isVisible():
print("is visible")
pass
else:
print("is not visible")
self.dlg.show()
# Run the dialog event loop
result = self.dlg.exec_()
# See if OK was pressed
if result:
#Do something