[QGIS-Developer] ForceSuppressFormPopup on QgsRelationEditorWidget

Tristan Kessler kessler at gbd-consult.de
Thu Sep 15 00:49:34 PDT 2022


Hi,

I'm working on a form (created in Qt Designer) that is using multiple 
instances of QgsRelationEditorWidget set to Attribute Table mode. I want 
to be able to quickly add entries in the table and therefore hide the 
form of the relation when I add features. Setting the form of the 
relation to not show (in the layer properties) is not an option because 
I need the form to show up in every other context.

When using the Drag and Drop form creation I'm able to set the "Force 
hide Form on add feature" Option on the Relation. This is exactly what I 
need but I want to provide a .ui file for the form.

Using the .ui file I do not have that option. I tried setting the Option 
through a python script (see below).

But the form still shows up even though the option is set to True.


def disablePopup(dialog, layer, feature):
     for w in dialog.findChildren(QgsRelationEditorWidget):
         w.setForceSuppressFormPopup(True)


Does anybody have a solution for this kind of problem? Or insights in 
why it doesn't behave the expected way?

Using QGIS 3.26 btw.


Regards,

Tristan Kessler

-- 
Mit freundlichen Grüßen,

Tristan Kessler


Geoinformatikbüro Dassau GmbH
Rethelstrasse 153
D - 40237 Düsseldorf
Tel: +49-211-69937751 (direkte Durchwahl)
Tel: +49-211-69937750 (Zentrale)
https://www.gbd-consult.de

Registergericht: Amtsgericht Düsseldorf, HR B 74022
Geschäftsführer: Otto Dassau



More information about the QGIS-Developer mailing list