This is probably a simple c++ question, but it's driving me up a wall.
Let say I have two variables:
The first simply tracks if a timer is running, and the second is a pointer to a reasonably large list of numbers. I want to be able to access these vars from every QFrame, QwtPlot, QWidget, etc in my program. As of now, I'm passing each through the constructor of each QObject. Previously I've set up nasty networks of signals and slots that bounce around between the objects to find one where the variable is in scope. There has got to be a better way.Qt Code:
bool running; QList<double> * data;To copy to clipboard, switch view to plain text mode
Is this the sort of thing that is allowable for declaring globally in main.cpp? There are so many warnings about that being bad...What is the Qt way of sharing these variables throughout my program?
Bookmarks