The user interface is designed in the file TrafficControl.ui, that is based on XML. That file contains the different widgets that makes up the user interface.
When compiling, TrafficControl.ui generates a corresponding header file that is called from the program (trafficControl.cpp/h):
I've added qDockWidgets to the form that contains the elements. A qDockWidget is basically a container that can dock to different borders of the applications interface. The user interface assigns some space on the form, depending on the size of the contents, other widgets and the user's decisions.
The file ui_trafficControl.h is generated at runtime from the file trafficControl.ui |
A qDockWidget can be closed (set to invisible) and floating (presented in a separate window) if the user wants to. A list of the qDockWidgets is shown if the user right-clicks on the title for a qDockWidget.
This is needed as my program grows and there will be much more information to present to the user.
I've recently learnt how to use qDockWidgets and I'll explore more of its abilities in a future blog post.
Future work:
Add a panel of pushButtons, one for each qDockWidget that is available in the program. The buttons should have icons that describe the contents, for example Map, Train List, Basic Controls, Log window...
No comments:
Post a Comment