Registered Member
|
Hello!
I am using marble within my own Qt application to show technical objects on the map. I am using the 15.08 release of marble. I would like to create different sets of my objects and to add them to treemodel as a document to display on the map. But I don't understand, how to update treemodel with this document? Fragments of my code:
If lines 17-29 are commented, all works good. Objects from mapSt1 are added on the map and removed from the map many times (by pressing special button in my application). But if I added objects from mapSt2, the program crashes on the line 31. Can you please tell me how to solve the problem? Excuse me for my English
Last edited by strag on Wed Mar 02, 2016 10:59 am, edited 1 time in total.
|
KDE Developer
|
Hi there,
the w->document() portion looks a bit odd. I assume you either mean document there, or you have created a subclass of MarbleWidget that provides this method. The crash in line 31 likely occurs because you updated the document before removing it, so its layout has changed and does not match the one the tree model expects. Regarding the actual update, try replacing line 28
|
Registered Member
|
Thank you very much for the quick reply!
About w->document(): it's my inattention, you are right, I have created a subclass of MarbleWidget. About the crash in line 31: thank you, I understand this. I tried replacing line 28 with
|
Registered Member
|
By now the problem is solved as follows:
When I need to update the document (to add or to remove technical objects), document is removed from the treemodel, modified and added to the treemodel again.
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], mesutakcan, Sogou [Bot]