Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top