开发者

How to get the file/resource path for a QIcon

开发者 https://www.devze.com 2022-12-10 04:56 出处:网络
So let\'s say I do something like this: QIcon myIcon(\":/resources/icon.ico\"); How can I later determine the path for that icon, e.g.

So let's say I do something like this:

QIcon myIcon(":/resources/icon.ico");

How can I later determine the path for that icon, e.g.

QString开发者_JS百科 path = myIcon.getPath();

The problem is, there is no getPath() member, and I can't find anything similar, but surely there must be a way!

I guess I could inherit the QIcon class and add this functionality, but it's probably built in and I'm overlooking it?


The filename isn't stored in QIcon, it's only used for constructing the image.

0

精彩评论

暂无评论...
验证码 换一张
取 消