[solved]How to check absence of icon in the resources
General and Desktop
3
Posts
2
Posters
6.5k
Views
1
Watching
-
wrote on 22 Aug 2012, 15:23 last edited by
I have problem with checking icon from resource. Code for example:
@
QIcon myIcon( ":/wrong/path/to/icon" )
myIcon.isNull() // return false but there is no icon
@How can I checked that icon is present in resources?
-
wrote on 22 Aug 2012, 15:28 last edited by
bq. "bool QIcon::isNull() const":http://qt-project.org/doc/qt-5.0/qicon.html#isNull
Returns true if the icon is empty; otherwise returns false.
An icon is empty if it has neither a pixmap nor a filename.
Note: Even a non-null icon might not be able to create valid pixmaps, eg. if the file does not exist or cannot be read.Use QFile::exists() instead.
-
wrote on 22 Aug 2012, 15:32 last edited by
Thanx QFile::exists() is what I need.
3/3