how to get response in QtWebKit

前端 未结 2 971
轻奢々
轻奢々 2020-12-17 00:18

im beginner with QtWebKit i build simple web frame that loaded page ( server side ) and when from this page i submit data i like to catch the response string from the serve

2条回答
  •  被撕碎了的回忆
    2020-12-17 00:41

    You can use QNetworkReply class for it. QWebPage instances have networkAccessManager() method that returns a QNetworkAccessManager instance capable of sending requests and receiving responses.

    You need to look for its finished signal.

    void QNetworkAccessManager::finished ( QNetworkReply * reply )

    This signal is emitted whenever a pending network reply is finished. The reply parameter will contain a pointer to the reply that has just finished.

    QNetworkReply in its turn is an inheritor of QIODevice therefore you are able to call its readAll() method in order to receive the response data.

    You may also find this question useful.

提交回复
热议问题