Busy with a plugin which retrieves (in separate threads) a lot of data from 2 w*s services.

I thought to use the QgsMessageBar to show progress of the (two) download processes, but stumbled on (I think) a problem:

- from api docs: https://qgis.org/api/classQgsMessageBar.html#details
The message bar will take ownership of the item...

My problem now is that (I think) my progressbars (which were place in a QgsMessageBar-item-widget) are sometimes deleted although I still want to use them...

For example: an user can click the little 'x' button in the messagebar to clean up all messages.
Or a python dev can call 'clean all widgets'.

BUT at that moment a progressbar part of a messagebaritem is (at least in cpp world) apparently deleted. Meaning, if (in the python world) I set a progress value on it, I get a nice clean segmentation fault....

I managed to work around this by NOT putting the progress bars in the messagebar (but put small ones in the plugin toolbar), but as several examples flow around on Google, I thought to speak out.

Should we just not let people do this?

Or was I using the messagebar for things I was not supposed to use if for?

Or should we make an option to add a 'special' widget to the messagebar, which is NOT removed using clearWidgets() (either via Python or via x-button)?

Regards,

Richard
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to