0

I'm trying to load image to pixmap. Image itself is added to resources. So here what I'm trying to do:

result = pixmap.load("Field/foreground.png");

result is always false. Image exists, I can get it's absolute path like this:

    QFile qfile("Field/foreground.png");
    QFileInfo qfileinfo(qfile);
    qDebug() << qfileinfo.absolutePath();

so path seems to be correct. And qt is running as admin. Any ideas?

PS I'm under Windows 7. The smae code was successfully tested on linux.

asclepix
  • 7,971
  • 3
  • 31
  • 41
Roman
  • 1,396
  • 4
  • 15
  • 39
  • 1
    Use QFile::exists() to check if the file really exists instead of just looking the path. –  Feb 21 '13 at 07:44
  • Well, it apparently not. Thanks @Roku. I've just mixed up two directories. Could you give -1 to my question, please?) – Roman Feb 21 '13 at 08:00

1 Answers1

0

Use QFile::exists() to check if the file really exists instead of just looking the path.- @Roku

Roman
  • 1,396
  • 4
  • 15
  • 39