質問

In QWebView if I drag/copy an image and drop/paste into a QWebView, it shows the path of image instead of image. How can I get this file path and show the image?

役に立ちましたか?

解決

Connect your webview page's network access manager finished signal with replyfinished slot of your class.

connect(webviewptr->page()->networkAccessManager(), SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));

In replyFinished you will get the QNetworkReply pointer for all resources like images, video etc. By using function url of QNetworkReply class you can check what kind of resources they are and read the content of those files.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top