Cotlone
6th May 2010, 01:28
Hey everyone,
I am developing an application for communication with a data acquisition board. I would like to save settings for the board in the program, and I'd like to know whether it would be better to use multiple models to handle different setting groups or to set up some form of hierarchical model with all the settings. For example I have some threshold settings and network settings (among others) and I wonder if I can set a view to only display part of the model (e.g. a list of thresholds). I guess I thought it would be nice to keep of the data together within the code but I'm not sure if this is possible.
Here is what I am in the midst of setting up at the moment, but I'm not sure if it is the right way to go about it...
settingsModel = new QStandardItemModel;
QStandardItem *networkSettings = settingsModel->invisibleRootItem();
// then build each of these items with children items later
QStandardItem *globalSettings = settingsModel->invisibleRootItem();
QStandardItem *thresholdSettings = settingsModel->invisibleRootItem();
QStandardItem *channelSettings = settingsModel->invisibleRootItem();
Does anyone have any input on this issue, thanks in advance for your help?
- Michael
I am developing an application for communication with a data acquisition board. I would like to save settings for the board in the program, and I'd like to know whether it would be better to use multiple models to handle different setting groups or to set up some form of hierarchical model with all the settings. For example I have some threshold settings and network settings (among others) and I wonder if I can set a view to only display part of the model (e.g. a list of thresholds). I guess I thought it would be nice to keep of the data together within the code but I'm not sure if this is possible.
Here is what I am in the midst of setting up at the moment, but I'm not sure if it is the right way to go about it...
settingsModel = new QStandardItemModel;
QStandardItem *networkSettings = settingsModel->invisibleRootItem();
// then build each of these items with children items later
QStandardItem *globalSettings = settingsModel->invisibleRootItem();
QStandardItem *thresholdSettings = settingsModel->invisibleRootItem();
QStandardItem *channelSettings = settingsModel->invisibleRootItem();
Does anyone have any input on this issue, thanks in advance for your help?
- Michael