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. QNetworkAccessManager::finished and QNetworkReply::finished how to emit?
Forum Updated to NodeBB v4.3 + New Features

QNetworkAccessManager::finished and QNetworkReply::finished how to emit?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.8k 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.
  • L Offline
    L Offline
    lvshuchengyin
    wrote on last edited by
    #1

    I use QWebView and QNetworkRequest to access the website with the same QNetworkAccessManager object.

    Now I want to catch all the QWebView requests include ajax request.

    So I want to use the QNetworkAccessManager::finished() signal.

    But the doc says: This signal is emitted in tandem with the QNetworkReply::finished() signal.
    I don't know the meaning of "tandem". Can I use both finished() signal?

    When I use QNetworkRequest I will use deleteLater() to delete at the finished() signal. Does it have problem, when i use QNetworkAccessManager::finished(QNetworkReply*) too?

    Can anyone tell me how to do .
    Thanks in advance!

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

      please finish your question.

      --- 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
      • L Offline
        L Offline
        lvshuchengyin
        wrote on last edited by
        #3

        Hello, could you know something about my question? My english is poor,but I tried to exress clearly

        [quote author="raven-worx" date="1387179686"]please finish your question.[/quote]

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

          No problem, if i remember correct you sentence ended and i couldn't read any question out of it. :)

          [quote author="lvshuchengyin" date="1387174273"]
          But the doc says: This signal is emitted in tandem with the QNetworkReply::finished() signal.
          I don't know the meaning of "tandem". Can I use both finished() signal?
          [/quote]

          Both signals are triggered. It should be sufficient to only connect to one of them. Use the one which fits more for you.

          [quote author="lvshuchengyin" date="1387174273"]
          When I use QNetworkRequest I will use deleteLater() to delete at the finished() signal. Does it have problem, when i use QNetworkAccessManager::finished(QNetworkReply*) too?
          [/quote]
          Yes, you should - must - use deleteLater() for the QNetworkReply object.
          You can call it in the slot connected to the finished signal or also connect directly:
          @
          connect( reply, SIGNAL(finished()), reply, SLOT(deleteLater()));
          @

          --- 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
          • L Offline
            L Offline
            lvshuchengyin
            wrote on last edited by
            #5

            It means I have to only use one of them.
            Thanks for your help! It helps me. :)

            [quote author="raven-worx" date="1387445713"]No problem, if i remember correct you sentence ended and i couldn't read any question out of it. :)

            [quote author="lvshuchengyin" date="1387174273"]
            But the doc says: This signal is emitted in tandem with the QNetworkReply::finished() signal.
            I don't know the meaning of "tandem". Can I use both finished() signal?
            [/quote]

            Both signals are triggered. It should be sufficient to only connect to one of them. Use the one which fits more for you.

            [quote author="lvshuchengyin" date="1387174273"]
            When I use QNetworkRequest I will use deleteLater() to delete at the finished() signal. Does it have problem, when i use QNetworkAccessManager::finished(QNetworkReply*) too?
            [/quote]
            Yes, you should - must - use deleteLater() for the QNetworkReply object.
            You can call it in the slot connected to the finished signal or also connect directly:
            @
            connect( reply, SIGNAL(finished()), reply, SLOT(deleteLater()));
            @

            [/quote]

            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