I created the framework necessary to run a repetitive background process, but god, it's messy!
Started to moved the init. to different functions instead of the constructor, because the code executed in constructors are in the main thread!
It finally works!
It finally works! The thread works fine and repeat itself! What I did is that I registered the meta object using qRegisterMetaType() in MainWindow. There is just a slight problem: Refreshing dynamically does not work, it dislays an error saying that timer cannot works in another thread (???) when refreshAPIs->refresh(); is called from MainWindow.
Cleaned up!
Fixed #9
I successfully implemented the manual refresh by connected the click signal directly to the refresh function in the thread. As the signal & slot system works between thread, the refresh function is executed in the background thread, and the QTimert_refresh works fine!
Works-ish
It finally works!
qRegisterMetaType()
inMainWindow
. There is just a slight problem: Refreshing dynamically does not work, it dislays an error saying that timer cannot works in another thread (???) whenrefreshAPIs->refresh();
is called fromMainWindow
.Fixed #9
QTimer
t_refresh
works fine!