[Interest] QIcon/QFile file extension matching

Jonathan Greig redteam316 at gmail.com
Tue Mar 4 07:50:28 CET 2014


Loading pixmaps into QIcon without an extension worked gloriously in Qt4.6
and in Qt4.7 it changed and required that you supply the extension. I have
no idea why it was changed but it definitely changed between those two
versions.


On Tue, Mar 4, 2014 at 12:41 AM, Damian Ivanov <damianatorrpm at gmail.com>wrote:

> Hi all,
>
> Is there a simple way to accept any file extension I try
>   QString fileNameString = "/usr/share/pixmaps/"+df.iconName()+".png";
>         QFile fileName(fileNameString);
>         if (fileName.exists())
>             return QIcon(fileNameString);
>
> and do this check for every extension, what I'd like is a simple way
> to accept any file extension.
>
>
> Thanks in advance
> Damian
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140304/bbe5a40c/attachment.html>


More information about the Interest mailing list