|Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions|
We are ready to start migrating the user interface for our project. As mentioned in the introduction, we do this in steps, ensuring that our application is still usable at every step of the migration process.
The user interface can be viewed as a hierarchy; each top-level window and dialog depends upon a parent (which is another top-level window or dialog). When using Motif XmMainWindow widgets, these should be viewed as two separate entities: the Main Window widget with the popup-menu hierarchy and the View widget contained in the Main Window widget. The View widget depends on the Main Window widget.
We begin migrating the pieces that have no dependencies, and work our way up the dependency tree until all the pieces have been migrated.
The hierarchy for this project looks something like this:
We will begin by migrating and replacing all of the dialogs, then the Main Window widget with popup-menu hierarchy, and finally the View widget.
However, we are not ready to begin just yet. The migration process can be long, but it does not have to be difficult. The Open, Save As, Page Delete and IO Error dialogs use Motif XmFileSelectionBox and XmMessageBox dialogs. Qt provides similar functionality with QFileDialog and QMessageBox, which we can begin using immediately.
The Print dialog is special, however. The Print dialog cannot be replaced until after we have replaced the View widget. Qt provides a complete printing mechanism with QPrinter, but we cannot start using it until we have replaced the View widget.
The Help dialog is also special. Instead of replacing the Help dialog with a custom QDialog, we will use the Qt Help System classes to provide a more advanced online help. However, we cannot start using classes like QToolTip and QWhatsThis until we replace the Main Window and View widgets.
The help text included with the original project is very small and only contains information about the XmNoteBook widget. The use of tooltips and whats-this text will suffice for this example. If your migration project has a large online help system, we recommend looking at the Simple HTML Help Browser example for information on how to build an rich text help system with hypertext navigation and full printing capabilities, or using Qt Assistant.
Removing the existing Help dialog is relatively simple. We remove the Xmd/Help.h, Xmd/HelpP.h and Xmd/Help.c files from our project file and regenerate our Makefile.
The code to create the Help menu and Help dialog is in todo.cpp. We remove the Xmd/Help.h include, the *help_manager resource string, the help_cb() function forward declaration and the help_widget global variable. We also need to remove the code that creates the Help dialog. We will also remove the code to create the Help menu, since this menu is now empty. Finally, we remove the help_cb() function implementation.
The Help dialog is now removed from our project. We cannot add QToolTip and QWhatsThis help at the moment, since we are still using XmMainWindow for the Main Window widget. Once we have migrated the Main Window and the popup-menu hierarchy, we can begin using QToolTip and QWhatsThis for online help.
[ Previous: Getting Started ] [ Home ] [ Next: Using Qt Standard Dialogs ]