Results 1 to 11 of 11

Thread: Event Queue Stop during download

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Question Event Queue Stop during download

    Hello,

    I have a file synchronisation class which is responsible to sync files between an local directory and a respository. Within this class I am downloading files.
    The problem I am facing is, that the application seems to stop/hang in the event queue while the file is downloading (after that it is proceeding and works as usual).

    I used the default setting for connect, Qt::AutoConnection which seems to use a QueuedConnection when used with threads to add it to the threads event loop.
    The network is managed with QNetworkAccessManager (_nam).

    Signals/slots for all the operations (within the downloader):

    Qt Code:
    1. _reply = _nam->get(QNetworkRequest(url));
    2. connect(_reply, SIGNAL(finished()), this, SLOT(httpFinished()));
    3. connect(_reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
    4. connect(_reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(httpDownloadProgress(qint64,qint64)));
    To copy to clipboard, switch view to plain text mode 

    I tried to shift the the class (fSync contains the downloader class) in another thread:

    Qt Code:
    1. fSync = new FSyncClass();
    2. fSync->moveToThread(_thread);
    3. connect(_thread, SIGNAL(finished()), _thread, SLOT(deleteLater()));
    4. connect(_thread, SIGNAL(finished()), fSync, SLOT(deleteLater()));
    5. _thread->start();
    To copy to clipboard, switch view to plain text mode 

    GDB shows:
    Qt Code:
    1. Main Thread-ID: 0xb6781000 //I call currentThreadId() to get this debug output within the main event loop
    2. [New Thread 0xb674b450 (LWP 1254)] //gdb output
    3. [New Thread 0xb5dff450 (LWP 1255)] //gdb output
    4. [New Thread 0xb53ff450 (LWP 1256)] //gdb output
    5. fSync Thread-ID: 0xb5dff450 //I call currentThreadId() to get this debug output within the class moved to the thread
    To copy to clipboard, switch view to plain text mode 

    So it seems like the class is really running in a separate thread.


    I am running out of ideas and would appreciate any help.

    Thank you in advance.
    Last edited by bmn; 11th January 2016 at 12:18.

Similar Threads

  1. Replies: 14
    Last Post: 17th January 2012, 09:01
  2. Event queue size
    By naroin in forum Qt Programming
    Replies: 7
    Last Post: 29th November 2010, 13:26
  3. What's the size of Qt event queue?
    By ShaChris23 in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2009, 17:54
  4. How to peek at the Event queue?
    By TheRonin in forum Qt Programming
    Replies: 3
    Last Post: 7th May 2009, 14:21
  5. Event Queue Question
    By TheGrimace in forum Qt Programming
    Replies: 10
    Last Post: 5th October 2007, 16:55

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.