Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从一个 url 设置我的 QIcon,我将它作为字符串传递,但它仍然没有向我显示任何图像,有没有其他方法可以做到这一点。
您需要使用QNetworkAccessManager来下载 QUrl 中的图像。您可以使用QImageReader将图像数据加载到 QImage。
这是一个很好的例子来说明这一点。