Results 1 to 7 of 7

Thread: QNetworkAccessManager multiple connect to finished signal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2014
    Posts
    8
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QNetworkAccessManager multiple connect to finished signal

    Hello! Thats almost all code (network communication part).

    I've already tried without deleteLater() but nothing changed.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager multiple connect to finished signal

    You are creating "UserApi friends" on the stack, it will be destroyed immediately after you call updateFriendsList().

    Btw, a QNetworkAccessManager can handle multiple requests, you don't necessarily have to create a new one for each request.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2014
    Posts
    8
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QNetworkAccessManager multiple connect to finished signal

    Howdy! So i should use singleton of ApiHandler or there is a different approach (with example)?
    Thanks in advance!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager multiple connect to finished signal

    Quote Originally Posted by Swiftie View Post
    Howdy! So i should use singleton of ApiHandler or there is a different approach (with example)?
    Just saying you don't have to use a different instance each time.

    Cheers,
    _

  5. #5
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: QNetworkAccessManager multiple connect to finished signal

    Quote Originally Posted by anda_skoa View Post
    You are creating "UserApi friends" on the stack, it will be destroyed immediately after you call updateFriendsList().
    Nice catch!
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

Similar Threads

  1. QNetworkAccessManager no finished() signal emitted
    By realperson in forum Qt Programming
    Replies: 4
    Last Post: 18th January 2018, 08:42
  2. QNetworkAccessManager - finished signal (when emitted)
    By RavensAngel in forum Qt Programming
    Replies: 4
    Last Post: 16th March 2016, 20:46
  3. Replies: 7
    Last Post: 14th November 2014, 16:29
  4. Replies: 7
    Last Post: 7th August 2014, 06:43
  5. QNetworkAccessManager does not signal finished
    By lukas.zachy in forum Newbie
    Replies: 5
    Last Post: 26th January 2011, 09:05

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.