I have a function called refreshLogDisplay()
in my MainWindow class which does a lot of UI work. The code in it is like this:
ui->tablewidget->setRowCount(100);
// ...
So the function deals with a lot of protected properties of MainWindow class. But I want to move the function to another QThread. In that QThread, I want a while loop to call the 'refreshLogDisplay' 500 times per second. The 500 times per second is very important, and I do not want any timer to do this because timers are too slow.
I only know how to implement a subclass inheriting QThread, which cannot access ui->tablewidget
things. There is a QObject::moveToThread() function, but it doesn't seem to help.
Any good suggestions?