Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why there's no QNetworkReply::error signal?
Forum Updated to NodeBB v4.3 + New Features

Why there's no QNetworkReply::error signal?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nikitablack
    wrote on last edited by
    #1

    Hello.

    The "documentation":http://doc-snapshot.qt-project.org/qt5-5.4/qnetworkreply.html#error-2 clearly says that there's a signal for QNetworkReply. I can't see it - in autocompletion there's only a function. Any attempt to connect to it results to compilation error.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      when you provide some code and more probably infos (used Qt version, etc.) someone may be able to help you.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nikitablack
        wrote on last edited by
        #3

        Sorry for confusion.

        QtCreator 3.3.0 with Qt 5.4.0.

        The code is:
        @QObject::connect(&reply, static_cast<void(QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), &onReplyErrors);@

        Here onReplyErrors is a global function. On compilation I have:

        bq. error: C2665: 'QObject::connect' : none of the 4 overloads could convert all the argument types

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The "&" in front of reply and onReplyErrors bother me a little.

          You usually get a pointer to QNetworkReply, not an instance of it so can you confirm you somehow got QNetworkReply object itself? Otherwise the first & shouldn't be there as it retrieves an address of a pointer, which is not good.

          Also, if onReplyErrors is a free standing function you don't need the extra & there (although it's not technically an error).

          1 Reply Last reply
          0
          • raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            [quote author="nikitablack" date="1422373746"]
            Here onReplyErrors is a global function.
            [/quote]
            -You can only connect to non-static MEMBER functions (slots) of a QObject-derived CLASS-.
            Nevermind, it's too early in the morning. ;)

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nikitablack
              wrote on last edited by
              #6

              Chris Kawa, you're right. Thank you. My bad - I copypasted this line but didn't notice that reply is a pointer. And the lack of this signal in autocompletion confused me.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved