![]() Registered Member ![]()
|
I'm trying to make my CSV export plugin to be user friendly, so I added a hourglass mouse cursor while loading or saving the files.
So first I set the hourglass with a QApplication::setOverrideCursor() call, then I call the png exporter several times (with KisDocument::ExportDocument() calls - I think these are really high level calls) and when I finish the exporting, I call QApplication::restoreOverrideCursor() to restore the original cursor. But I found a strange thing in the png exporter plugin. There is also a QApplication::restoreOverrideCursor() call in the plugin, but there is no matching QApplication::setOverrideCursor() in the same plugin code. It seems the other image exporter plugins (jpg etc) are containing this feature too. This means whenever the plugin called and it saves a picture,, it also decreases the mouse cursor override level by one. So when I call the png exporter, it calls this restoreOverrideCursor() and it drops my hourglass. I think the set() and restore() calls supposed to come in pairs. There must be a reason why the plugins are designed this way, just I can't understand it. So my question is, why is it there? Is it intentional? |
![]() KDE Developer ![]()
|
I think that it would be better to use the png converter directly. It's in kritaui for that reason; check how the kra exporter uses it to export the png thumbnail and merged image. The API is exceedingly simple, but take care that when using the png converter class that you should make absolutely sure that the layer's colorspace is supported by the png converter!
(To directly answer your question: the reasons the plugins work that way is because I did it that way in 2004, which was wrong, and the file import/export plugin system needs rework!) |
![]() Registered Member ![]()
|
ok, thanks, that's a good idea, maybe it will be even faster a bit. I will check it for the png import part as well.
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]