Results 1 to 1 of 1

Thread: Fill a QTableWidtget in a separate thread

  1. #1
    Join Date
    Jan 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Fill a QTableWidtget in a separate thread

    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.
    Attached Files Attached Files
    Last edited by szabolcsx; 28th January 2015 at 16:55.

Similar Threads

  1. -how to run a function in separate thread
    By shivendra46d in forum Newbie
    Replies: 22
    Last Post: 28th October 2013, 07:20
  2. How to Have a class run in a separate thread.
    By sona1111 in forum Newbie
    Replies: 7
    Last Post: 29th August 2013, 07:44
  3. GUI Updates from separate Thread
    By sa5webber in forum Newbie
    Replies: 5
    Last Post: 16th June 2012, 21:08
  4. new QWidget in separate thread
    By magland in forum Qt Programming
    Replies: 15
    Last Post: 7th February 2008, 13:32
  5. handling paintGL in a separate thread
    By al101 in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2007, 18:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.