deepakn
24th August 2009, 08:30
Hello all,
I have an application with separate .ui file for the GUI.
Now the UI has a statistics page with few tables which needs to update some data periodically. Data is fetched from backend[written in C] using a simple [update]function. This function involves certain manipulations on UI elements(ex: ui.trafficStatsTable->setItem(row, 1, resourceItem2); ).
Now i want to update the table repeatedly in a separate thread. I havent used threads before.
I tried pthreads and am not able to implement the required function as void*
Then I went for QThread. Again, faced several problems. I was not able to access the UI elements.
I found this in our documentation.
In GUI applications, the main thread is also called the GUI thread because it's the only thread that is allowed to perform GUI-related operations. Could someone please explain what this means? Does it mean that simple operations like filling a table with data cannot be done in a different thread?
Could someone provide some help please? Any pointers to some examples involving threads where UI is done separately would be of much help.
Thanks in advance.
Deepak
I have an application with separate .ui file for the GUI.
Now the UI has a statistics page with few tables which needs to update some data periodically. Data is fetched from backend[written in C] using a simple [update]function. This function involves certain manipulations on UI elements(ex: ui.trafficStatsTable->setItem(row, 1, resourceItem2); ).
Now i want to update the table repeatedly in a separate thread. I havent used threads before.
I tried pthreads and am not able to implement the required function as void*
Then I went for QThread. Again, faced several problems. I was not able to access the UI elements.
I found this in our documentation.
In GUI applications, the main thread is also called the GUI thread because it's the only thread that is allowed to perform GUI-related operations. Could someone please explain what this means? Does it mean that simple operations like filling a table with data cannot be done in a different thread?
Could someone provide some help please? Any pointers to some examples involving threads where UI is done separately would be of much help.
Thanks in advance.
Deepak