
Chapter 4. Implementation 61
Figure 4.21.: The visualization menu showing the database in receiver view.
reason, the visualization node contains a local copy of the database, in order to prevent high data
traffic to the device manager node and to speed up access times. In order to further increase
the overall performance, two QMultiHash containers were implemented to allow fast accessing
single elements of the QGraphicsScene, as it does not provide functions for effectively searching
for items. QMultiHash is used, as devices can appear multiple times in the right column of the
tree model and consequently there can be multiple entries with the same name in the hash list.
As the QGraphicsScene is just a storage class for devices, the class QGraphicsView was used to
render and display the items. The order of items is random, because the QHash lists of the device
manager class are unsorted.
The visualization menu is connected via two signals to the device manager class: a device state
change notification and a database change notification. The database notification indicates that a
device has been removed, added or changed and causes the QGraphicsView to completely redraw
the scene. The device state notification implies that a transmitter has been seen and several
receivers have changed. Due to the QMultiHash containers, single updates are possible and the
whole scene need not be rendered completely.
Kommentare zu diesen Handbüchern