Re: Cannot Show SVG with QWebEngineView
Vincent Vande Vyvre <[email protected]>
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <[email protected]> |
Le 16/10/19 à 22:51, Tong Zhang a écrit : > Hello, > > I'm trying to use QWebEngineView to display a SVG image, but just got > the empty, below is the code: > filename: show_svg.py > > from PyQt5.QtWidgetsimport QApplication > from PyQt5.QtCoreimport QUrl > from PyQt5.QtWebEngineWidgetsimport QWebEngineView > > import sys > > > app= QApplication(sys.argv) > svg= QUrl(sys.argv[1]) > view= QWebEngineView() > view.load(svg) > view.show() > > sys.exit(app.exec_()) > > Please find attached SVG file, the testing command is 'python3 > show_svg.py test1.svg'. Thanks for your help. > > Tong > > _______________________________________________ > PyQt mailing list [email protected] > https://www.riverbankcomputing.com/mailman/listinfo/pyqt Try with /QUrl.fromLocalFile(sys.argv[1])/ / / Vincent _______________________________________________ PyQt mailing list [email protected] https://www.riverbankcomputing.com/mailman/listinfo/pyqt