I know it is not possible to do GUI operations from a QThread but I was wondering if it is possible to read the text of something like a QComboBox or a QRadioButton or QLineEdit etc from the QThread in question.
I know it is not possible to do GUI operations from a QThread but I was wondering if it is possible to read the text of something like a QComboBox or a QRadioButton or QLineEdit etc from the QThread in question.
No! Do not do that.
There are a couple of things you can do to get that information in your thread.
1. Create a settings file that you open from within the object in your thread.
2. Pass the settings to the object in your thread before starting the thread.
3. Use signals and slots between your ui and the object in your thread.
4. Have a simple variable (QString) somewhere that holds the value and read from this variable (remember about protecting it with a mutex if the value of the variable may be changing).
Bookmarks