The string "lit://publicationoverview" indicates, that the widget PublicationOverview should be loaded. The widged will be loaded by MainWindowImpl::showPublicationOverview(). This one is more complex: "lit://bibliography/publication?no=9939". It indicates that the widget Bibliography should be loaded. The data which will be displayed in the widger comes from the table "publication". The clause behind the "?" indicates a kind of sql-"where"-clause. Its the record from table publication with "no=9939". A "lit://author?new" signals to the Author widget that a new author should be created. The url can be manipulated by editing the text-input of the toolbar (next to back-forward buttons).
The class LitUrl encapsulates the lit-url.
It is sent through the qt-event queue. The following code from Part causes the current Part-object to be unloaded. The new widget PartMemo will be loaded instead.
void Part::showPartMemo() {
qApp->postEvent(topLevelWidget(), new UrlEvent(LitUrl("lit://partmemo/part?no="+no(url())), false));
}
The event is received by MainWindowImpl::customEvent() . This method handles the loading and unloading of the widgets.
It is inherited by a number of widgets like AuthorOverview ,..., State , and Search. ReadWriteFormBase extends the functionality of ReadOnlyFormBase. It manages a QSqlCursor and provides the database - locking mechanisms. Classes like Author, File, and PartMemo inherit this class. The differentiation between ReadOnlyFormBase and ReadWriteFormBase is currently somewhat messy and needs some cleanup in the future.
authorform->parts->clear();
fillpart=new FillLinkListBox(this, "partauthorfllb", authorform->parts,
"select part.no, part.title from part, part_author " <br> "where part.no=part_author.part_no and part_author.author_no="+no+" "<br> "order by part.title", "part/part", loadPixmap("showpart.png"));
fillpart->start();
threads.append(fillpart);
A LinkListBox is to be filled with the parts written by a specific author ("authorform->parts"). The class FillLinkListBox retrieves the necessary data in the background and ensures that is inserted into the LinkListBox. This is done in a seperate thread. Each widget which is inherited from ReadWriteFormBase has a list with pending threads. Each running threads must be inserted into this list in order to ensure that the thread is properly cleaned up before the destuction of the current widget.