感觉svg图片一点都不好用,还是用jpg图片,使用QPixmap::scale缩放函数比较好。
qt使用QSvgWidget打开test.svg提示:Image file name is empty
<image id="image0" width="1405" height="795" x="0" y="0" href=".....">
仔细看里面有一个<image>标签,里面少了一个xlink:href="test.png" ,修改如下:
<image id="image0" width="1405" height="795" x="0" y="0" xlink:href="test.png" href=".....">
test.png名称与test.svg文件基本名称(test)相同