mardi 15 décembre 2015

Seperating data handling from GUI

I'm developing a network-testing-tool which has a graphical user interface. The problem I'm facing now is, that I can't separate the underlying data from the GUI classes. The application consists of a QMainWindow which then spawns several other QDialogs and has some QWidgets. In each of these classes there is some functionality using QLineEdits, QPushButtons and so on and also data is stored in each class. Right now, in order to use data about a device from, for example, the DeviceDiscovery Widget in the MainWindow I need to use

deviceId = self.widget_deviceDiscovery.devices['devName'].id

instead of being able to store it outside of the whole GUI. But how could I accomplish this? It just doesn't seem right to store the data in the GUI classes.

Aucun commentaire:

Enregistrer un commentaire