<div dir="ltr">Hi<div><br></div><div>I am writing documentation about custom forms, but I am encountering some problems.</div><div><br></div><div>In the case of QGIS 2, it seems that there is no way of avoiding the dialog to be closed when the OK button is clicked. I read this <a href="https://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/">blog post </a>by Nathan, in which it disconnects the default 'accepted' signal from the 'dialog.accept' slot. I tried that, but it doesnt seem to be working. It runs the validation function that I connect to that signal, but even if I dont accept the dialog in that function, it closes it.</div><div><br></div><div>I also tried using the disconnectButtonBox() method of the QgsAttributeForm class, but it does nothing. The buttons still do their work.</div><div><br></div><div>Is this a bug, or I am doing something wrong?</div><div><br></div><div>In QGIS3, it seems that now only the ui file can be provided, but not a python file with the form logic. How is that added now?<br></div><div><br></div><div>Thanks!</div></div>