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



  • 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!


  • Moderators

    please finish your question.



  • 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]


  • Moderators

    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()));
    @



  • 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]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.