So don't use Model/View, because in View you uses labels and other things which are not commonly used there, because it is not the place for QLabels. And don't use Model if you do not use its API in anyway.
My idea would be to make some class which will read all this things through the serial port with some API for exposing this data to the world in your specific way and have some signals to notify about changes, like:
{
Q_OBJECT
public:
// ... c'tor and stuff
double temperature() const;
signals:
void temperatureChanged(double temp);
};
class DataObject : public QObject
{
Q_OBJECT
public:
// ... c'tor and stuff
double temperature() const;
signals:
void temperatureChanged(double temp);
};
To copy to clipboard, switch view to plain text mode
Add then create widget with all those labels, Qwt things and anything you want and make there slots for reacting for this data changes.
Bookmarks