Qt .svg icon 不显示

知识恶补侠 2017-03-01 11:02:49
Qt5.7 通过QSS加载图标 如: QToolButton{image:url(:/images/icon.svg}, 在本机上显示正常, 在别的电脑上你运行不起来。而将.svg换成.png之后,在别的电脑上也能显示正常。百度谷歌了一天仍未解决,求大神指点。开发环境Win10+VS2015+Qt5.7_x86, 另一台机器win764位。
...全文
1271 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
知识恶补侠 2017-03-02
  • 打赏
  • 举报
回复
引用 8 楼 dowithsmiles 的回复:
Qt5Svg.dll加了吗?
加上之后能正常显示了, 谢谢
windywater119 2017-03-01
  • 打赏
  • 举报
回复
有没有打包svg插件?
知识恶补侠 2017-03-01
  • 打赏
  • 举报
回复
自己顶下先!!!
windywater119 2017-03-01
  • 打赏
  • 举报
回复
Qt5Svg.dll加了吗?
知识恶补侠 2017-03-01
  • 打赏
  • 举报
回复
引用 6 楼 dowithsmiles 的回复:
[quote=引用 3 楼 wd350355942 的回复:] 必须要 .svg吗?
是,代码里用QCoreApplication::addLibraryPath指定插件位置[/quote] 代码中已加 QCoreApplication::addLibraryPath("./plugins") ,运行目录也加了plugins/imageformats文件夹,文件夹内也复制了qsvg.dll等文件。在别的机子上还是不能显示。
windywater119 2017-03-01
  • 打赏
  • 举报
回复
引用 3 楼 wd350355942 的回复:
必须要 .svg吗?
是,代码里用QCoreApplication::addLibraryPath指定插件位置
知识恶补侠 2017-03-01
  • 打赏
  • 举报
回复
引用 3 楼 wd350355942 的回复:
必须要 .svg吗?
有必要,矢量图显示效果更好
知识恶补侠 2017-03-01
  • 打赏
  • 举报
回复
引用 2 楼 dowithsmiles 的回复:
有没有打包svg插件?
你指的是plugins/imageformats 下面的文件与运行文件一起打包?
Z_墨脱 2017-03-01
  • 打赏
  • 举报
回复
必须要 .svg吗?
kaidan 基于Qt Qxmpp Linux平台 IM 源代码 C++ # Kaidan - A user-friendly XMPP client for every device! [![Kaidan MUC](https://search.jabbercat.org/api/1.0/badge?address=kaidan@muc.kaidan.im)](https://i.kaidan.im) [![Flatpak Build Status](https://binary-factory.kde.org/buildStatus/icon?job=Kaidan_flatpak)](https://binary-factory.kde.org/job/Kaidan_flatpak/) [![Translation](https://hosted.weblate.org/widgets/kaidan/-/svg-badge.svg)](https://hosted.weblate.org/projects/kaidan/translations/) [![license](https://img.shields.io/badge/License-GPLv3%2B%20%2F%20CC%20BY--SA%204.0-blue.svg)](https://raw.githubusercontent.com/kaidanim/kaidan/master/LICENSE) [![Donations](https://img.shields.io/liberapay/patrons/kaidan.svg?logo=liberapay)](https://liberapay.com/kaidan) ![Kaidan screenshot](https://www.kaidan.im/images/screenshot.png) ## About Kaidan is a simple, user-friendly Jabber/XMPP client providing a modern user interface using [Kirigami][kg] and [QtQuick][qquick]. The back-end of Kaidan is written in C++ using the [QXmpp][qxmpp] XMPP client library and [Qt 5][qt]. Kaidan runs on mobile and desktop Linux systems, including Plasma Mobile and [Ubuntu Touch][openstore]. There are static Windows builds and macOS is also supported, but we currently can't provide builds for it. The support for the legacy mobile systems Android and iOS is very experimental and we currently only provide test builds for [Android][android]. We might support SailfishOS in the future in case the Sailfish SDK gets an update for Qt. Kaidan is *not* finished yet, so don't expect it working as well as a finished client will do -- Many features are still missing, many things still need to be fixed and improved. For a list of supported XEPs, have a look at the [Wiki][supp-xeps].

16,212

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧