In this third and last example I will show the KTutorial implementation of a tutorial for Gwenview.
Like the previous tutorial for Kdenlive, this tutorial was made after the release of KTutorial 0.5, so nothing had to be changed in KTutorial to implement it. Unlike the Kdenlive tutorial, for this one I had to modify Gwenview code for something else than just to use KTutorial. But it was not to add object names like for the showFoto tutorial. In this case, I added a little hack to reparent KActions from the main KActionCollection to the main application window.
The KActionCollection created by KXmlGuiWindow (the base class of the main application window) is not parented to the main application window. However, the KActions are parented to the KActionCollection. KTutorial scripted tutorials (like those exported from the editor) can only find objects that are descendants of the main application window, so the KActions have to be reparented to the main Gwenview window to be found by KTutorial.
Note that reparenting the KActions is not mandatory for KTutorial to work with Gwenview (or any other application). However, it provides a more interactive experience, at least with the tutorial I implemented in this example. If the KActions could not have been used the tutorial could have been written anyway, but it would have contained more “Continue” buttons to change to the new step, instead of changing when the user does what he is asked to do.
Well, here it is the video showing the tutorial being followed in Gwenview (Theora, 1280×800, 12MB). The source for this tutorial, which can be viewed and edited using KTutorial editor, can be downloaded here: “Full screen interface” tutorial for Gwenview.
I hope you have liked this three example series and, who knows, maybe become interested about KTutorial 🙂