Results 1 to 4 of 4

Thread: Receiving reply from page

  1. #1
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Receiving reply from page

    I looking for some method of reciving reply from page instead of EventLoop, like here:
    Qt Code:
    1. bool Engine::connection(){
    2. request.setUrl(QUrl(sUrl));
    3. reply = manager->get(request);
    4. connect(reply, SIGNAL(readyRead()), eventLoop, SLOT(quit()));
    5. eventLoop->exec();
    6. //read reply
    7. return reply->error() ? false : true;
    8. }
    To copy to clipboard, switch view to plain text mode 
    How can I read it in a different way without using new slot?
    I also tried waitForReadyRead function, but it doeasn't work.
    Last edited by Trok; 29th September 2011 at 12:11.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Receiving reply from page

    What's wrong with using an event loop?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    Trok (29th September 2011)

  4. #3
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Receiving reply from page

    It looks for me very strange when i use in every function loop to recive any data, and don't know why doesn't have function like waitForReadyRead().

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Receiving reply from page

    You don't want slots, you don't want event loops... So why are you using Qt in the first place? You want waitForReadyRead() which does the same as waiting on an event loop. If you don't want to write the same code many times then just write a function that will do that for you. You can even call it "waitForReadyRead".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Load a simple Page after the Main Page.
    By mrhevor in forum Qt Quick
    Replies: 1
    Last Post: 27th September 2011, 10:32
  2. QTabWidget remove a page at the page's request
    By thomaspu in forum Qt Programming
    Replies: 2
    Last Post: 29th December 2007, 20:45

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.