what qwidget subclass?
-
QFile::exists() gives false when i use a full path for the image (like, C:\Users\user\image.png). but the file sure exists. i've tried using \\ instead of \, also / but not much success. with resource system, however, everything is okay
-
@user4592357
if you take one of the paths from the file
and start paintbrush, select file->open
and paste the path into the filename area. and then press open.
will it then open ?it sounds really, really wrong if QFile::exists() says false.
-
Hi
Did you try to qDebug() << file.filePath();
to see if anything still 100% like the one in file? -
@user4592357
Really cannot guess then.
If path in text file truely are valid syntax, it should just work.
and you are 100% sure you escape it ?
( which is needed when inside the code, but from text file)setIcon("C:\\Users\\user\\image.png");
-
@user4592357
I have done it many times so I do
wonder what you do that is
different or if it really just is a path issue. -
Hi,
Since you are using Qt, why not use the Unix notation ? Qt handles the conversion when it calls the related platform specific functions.
So it should be
C:/Users/user/image.png
-
Does that file have any permission issues ?
Are you 100% sure that it's there ?
Are you loading it from your own user account ?
Any special char in the path ? i.e is user really the account name ?