KTutorial was designed trying to keep model and view as decoupled as possible to ease changes in model and view. To achieve this, it relies heavily in Qt's signals and slots model, so model and view are mostly connected through them.
Some view classes know some specific model classes, and vice versa, but in general the notification happens by signals and slots means.
The view contains classes for tutorial and tutorial management modules. In the future it may be desirable to subdivide the view in submodules, but right now just a main module suffices as there are only three classes specific of the view.
Tutorials are shown to the user through TutorialWidget
. This is just a derived QFrame
which implement a borderless widget that can be dragged on the screen using the mouse.
This widget shows the text of each step to the user and the options, if any. It is notified by Tutorial
signals when a new Step
is activated, and it queries the Step
to get the information to show to the user.
It also notifies Tutorial
when the user closes it so the chain of events for tutorial finalization is started.
To start tutorials, the user must be able to know which tutorials are available. TutorialManagerDialog
implements a dialog that shows all the available tutorials in a list and allows the user to start the desired one. The dialog is shown when the user clicks in .
To get the available tutorials, TutorialManagerDialog
needs querying a TutorialManager
. However, this isn't done by itself, but by its tutorials list. Following Qt 4 Model-View architecture for list views and other widgets, a special model class TutorialListModel
was created to handle querying a TutorialManager
about the available tutorials, using their TutorialInformation
.
Here they are the final diagrams for tutorial view design, that includes all the explained elements and shows (if size doesn't prevent it) the relations between each of them.
They are shown as different diagrams because, although they both are part of view module, the classes have no relation among them.