[Qgis-user] QCompleter in QGIS form
Blumentrath, Stefan
Stefan.Blumentrath at nina.no
Sun Mar 29 04:55:26 PDT 2015
Hi again,
Now I spend some more thoughts on 2) and consider to write a Python macro for project start, which runs the query and writes results (completer items) kind of hard-coded into the form init function (meaning I will have to have a template for the form init function, which then is saved with the final name (overwriting earlier versions), while completer items are being injected).
Do you think such a solution will cause the form to open faster (depending on the connection speed to the data base probably)? Or is it almost equally costly to load a rather long init-function (python script text fie)?
Cheers,
Stefan
P.S.: Esp. help on 1) is still most welcome...
P.P.S.: If it is of interest for others I could publish / document my QCompleter solution on github...
>Yet there are two things I am struggling with:
>1) Would it be possible to use this QCompleter solution to an autogenerated form? The auto generated forms are more than good enough for most of my >use-cases. When I tried the Init function on an autogenerated form I got "NameError: global name 'TextEdit' is not defined"... Any ideas how to fix >that?
>
>2) It seems to me that the query - which is used to fill the QCompleter - is executed each time the form is opened. Would it be possible to avoid this, I >mean that the query is only run once (e.g. when I open the project)? I hoped this could speed up the start of the form (even if the query gets cached in >PostgreSQL)...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150329/cb89ab70/attachment.html>
More information about the Qgis-user
mailing list