Re: [QGIS-Developer] Issues with custom forms with Python (in both QGIS 2 and QGIS 3)

2018-02-07 Thread Victor Olaya
Thanks! Looks like i was using an older version, not up to date, and the
button was not there.

good to see that some one else is using this as well :-)

Thanks again!

2018-02-06 9:04 GMT+01:00 Tudor Barascu :

> Hi Victor,
>
> I had the same problem in finding where to put the python logic in QGIS 3.
> Here you go: python_logic.jpg
> 
>
> python_logic.jpg
>
> Shared with Dropbox
> 
>
> In the image above it's a button on the right of the Provide ui-file and
> on the left of the "Show form on add feature...
>
> Regards,
> Tudor
>
>
> On Tuesday, February 6, 2018, 9:33:27 AM GMT+2, Victor Olaya <
> vola...@gmail.com> wrote:
>
>
> Hi
>
> I am writing documentation about custom forms, but I am encountering some
> problems.
>
> 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 blog post
> 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.
>
> I also tried using the disconnectButtonBox() method of the
> QgsAttributeForm class, but it does nothing. The buttons still do their
> work.
>
> Is this a bug, or I am doing something wrong?
>
> 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?
>
> Thanks!
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Issues with custom forms with Python (in both QGIS 2 and QGIS 3)

2018-02-06 Thread Tudor Barascu
 Hi Victor,
I had the same problem in finding where to put the python logic in QGIS 3.Here 
you go: python_logic.jpg

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
python_logic.jpg

Shared with Dropbox
 |

 |

 |


In the image above it's a button on the right of the Provide ui-file and on the 
left of the "Show form on add feature...
Regards,TudorĀ 

On Tuesday, February 6, 2018, 9:33:27 AM GMT+2, Victor Olaya 
 wrote:  
 
 Hi
I am writing documentation about custom forms, but I am encountering some 
problems.
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 blog post 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.
I also tried using the disconnectButtonBox() method of the QgsAttributeForm 
class, but it does nothing. The buttons still do their work.
Is this a bug, or I am doing something wrong?
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?

Thanks!___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer  ___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] Issues with custom forms with Python (in both QGIS 2 and QGIS 3)

2018-02-05 Thread Victor Olaya
Hi

I am writing documentation about custom forms, but I am encountering some
problems.

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 blog post
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.

I also tried using the disconnectButtonBox() method of the QgsAttributeForm
class, but it does nothing. The buttons still do their work.

Is this a bug, or I am doing something wrong?

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?

Thanks!
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer