-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a layer from py plugin, with QgsVectorLayer.setEditFormInit (QString function) set #12760
Comments
Author Name: Giovanni Manghi (@gioman) Hi, feedback to your problem the problem would be better asked in the developer mailing list. |
Author Name: Alex Mandel (Alex Mandel) Needs to be retested on a newer trunk, not a showstopper for release. |
Author Name: Martin Dobias (@wonder-sk) This could have been fixed recently in 52a49c9 (SVN r13752), please test again. If the problem persists, please provide further information how to replicate the problem. Can you simply add a layer and set a QML with "editforminit" function to get the crash (without using the plugin)? |
Author Name: Giuseppe Sucameli (@brushtyler) No user's inputs for 5 weeks... |
Author Name: jaanussuvi - (jaanussuvi -) Replying to [comment:4 wonder]:
Sorry, I've finished my project with the´plugin, and i do not have development environment setup anymore. So it's really time consuming to test it. btw the plugin doesn't use custom editform or init function. I solved it differently.
Yes, if i add a postgis layer to my qgis project with custom editform, then it works fine. But if i add postgis layer with python, and try to add new object to the layer, then it does not work. But if i save newly created layer to gqis project and restart gqis, then it works. How to replicate: U should have postgis db and qml for some geo object. Code that creates vector layer from postgis: Sorry, i'm too busy with new projects. |
Author Name: Paolo Cavallini (@pcav) Closing it pending reporter check. Please reopen it if necessary.
|
Author Name: jaanussuvi - (jaanussuvi -)
Original Redmine Issue: 2700
Redmine category:python_plugins
Briefly about my case:
I created a python plugin,
and it creates [[QgsVectorLayer]]'s from Postgis database.
I do add qml styles to my layers, with layer.loadNamedStyle(path_to_qml).
And in qml i've specified form init functions in python myInitMethod
I'm trying to initilize some data fields with editforminit function.
The problem:
i add a layer with my plugin
select the added layer which has specified
toggle the layer to edit mode
try to add a layer object to map, click on the map
then qgis always craches
Problem is only when i have set editforminit function.
but if i do
steps
(save project)
(close and open qgis)
before adding new object to my layer, then editforminit function is invoked and everything works.
Maybe there's a workaround?
Maybe some refreshing?
I do after adding layers:
self.iface.refreshLegend(myLayer)
self.iface.mapCanvas().refresh()
The text was updated successfully, but these errors were encountered: