<div dir="ltr"><div>Hello,</div><div><br></div><div>I'm trying to use QWebEngineView to display a SVG image, but just got the empty, below is the code:</div><div>filename: show_svg.py</div><div><br></div><div><pre style="color:rgb(0,0,0);background:rgb(255,255,255) none repeat scroll 0% 0%"><span style="color:rgb(128,0,0);font-weight:bold">from</span> PyQt5<span style="color:rgb(128,128,48)">.</span>QtWidgets <span style="color:rgb(128,0,0);font-weight:bold">import</span> QApplication
<span style="color:rgb(128,0,0);font-weight:bold">from</span> PyQt5<span style="color:rgb(128,128,48)">.</span>QtCore <span style="color:rgb(128,0,0);font-weight:bold">import</span> QUrl
<span style="color:rgb(128,0,0);font-weight:bold">from</span> PyQt5<span style="color:rgb(128,128,48)">.</span>QtWebEngineWidgets <span style="color:rgb(128,0,0);font-weight:bold">import</span> QWebEngineView
<span style="color:rgb(128,0,0);font-weight:bold">import</span> sys
app <span style="color:rgb(128,128,48)">=</span> QApplication<span style="color:rgb(128,128,48)">(</span>sys<span style="color:rgb(128,128,48)">.</span>argv<span style="color:rgb(128,128,48)">)</span>
svg <span style="color:rgb(128,128,48)">=</span> QUrl<span style="color:rgb(128,128,48)">(</span>sys<span style="color:rgb(128,128,48)">.</span>argv<span style="color:rgb(128,128,48)">[</span><span style="color:rgb(0,140,0)">1</span><span style="color:rgb(128,128,48)">]</span><span style="color:rgb(128,128,48)">)</span>
view <span style="color:rgb(128,128,48)">=</span> QWebEngineView<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span>
view<span style="color:rgb(128,128,48)">.</span>load<span style="color:rgb(128,128,48)">(</span>svg<span style="color:rgb(128,128,48)">)</span>
view<span style="color:rgb(128,128,48)">.</span>show<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span>
sys<span style="color:rgb(128,128,48)">.</span>exit<span style="color:rgb(128,128,48)">(</span>app<span style="color:rgb(128,128,48)">.</span>exec_<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,128,48)">)</span></pre></div><div><br></div><div>Please find attached SVG file, the testing command is 'python3 show_svg.py test1.svg'. Thanks for your help.</div><div><br></div><div>Tong<br></div></div>