When I open a form with "Identify Features", I would like to have it always at the same position (top left corner or in the center of the screen). Usually it moves every time I open it a little bit down and to the right and I have to get it back manualy to the start position.

I don't know Python, but I think I can do it somehow with the Python Init Code Configuration in the Layer properties. What code do I need to open the form on the top left corner or in the center of the screen? I saw the question from user99 and question from kadeem, but I cannot bring this information to the Python Init Code Configuration from QGIS 3.16.

Which code do I need instead of the example code:

from qgis.PyQt.QtWidgets import QWidget
def my_form_open(dialog, layer, feature):
    geom = feature.geometry()
    control = dialog.findChild(QWidget, "MyLineEdit")


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.