PDA

View Full Version : Fill a QTableWidtget in a separate thread



szabolcsx
28th January 2015, 16:55
Hi everybody. I want to make an application which manages a MySQL database. My first need is to display some data on QTableWidget. To avoid frozen UI, I'm running the query in separate thread. I update the QTableWidget line by line, but when the query finishes, my program crashes. I made a minimal example which produces the same error. I also tried to implement a stop mechanism using QThread::isInterruptionRequested() and QThread::requestInterruption(), but I get the same crash. I have attached the source code.

Added after 43 minutes:

I have actually found a solution. I'm doing in a right way? Thanks for any help.