문제

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