Results 1 to 7 of 7

Thread: Waiting for a download event

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    merajc Guest

    Default Re: Waiting for a download event

    Thank you for your help

    The reason I can't put the rest of the code in the slot is that they're two different classes, and need to be separated.

    Is there any way I can make the app wait by making a MessageBox pop-up and only leave after the download is finished? Or any other method that allows me to make the app wait for the download to be finished?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 268 Times in 268 Posts
    Wiki edits
    20

    Default Re: Waiting for a download event

    You have your mind set on a synchronous connection.
    While, as stated already, the get() function is asynchronous.

    You want to use the finished() signal.
    And you need to change the program logic to deal with this. This should not be too hard.
    Basically, create a signal in your xmlReader class that fires when the networkaccessmanager finished() signal is fired. Before that, the xmlReader class can do the necessary parsing.
    Then connect a slot from your WallPaperselection class to the xmlReader finished signal.
    Then use some getter functions to get the needed data.

  3. The following user says thank you to tbscope for this useful post:


  4. #3
    merajc Guest

    Default Re: Waiting for a download event

    Thank you for your reply

    I actually tried implementing a signal and slot yesterday to do this, but it didn't work.

    Went over my Qt book and now it works great. Thanks you once again!

Similar Threads

  1. Replies: 1
    Last Post: 9th July 2009, 09:59
  2. Waiting WebKit
    By giusepped in forum Qt Programming
    Replies: 0
    Last Post: 13th May 2009, 04:40
  3. Waiting for multiple threads
    By Bebee in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2008, 18:21
  4. Waiting on a thread?
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2007, 17:13
  5. Waiting for something
    By JonathanForQT4 in forum Newbie
    Replies: 20
    Last Post: 2nd May 2007, 18:35

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
  •  
Qt is a trademark of The Qt Company.