3

Normally you can get last modified date easily with QFileInfo::lastModified(). However this doesn't work when a file inside Qt's resource system is used

QFileInfo resourceInfo("://resource.txt");
qDebug() << resourceInfo.lastModified().toString() // returns ""

Is there a possibility to find out the last modified date without temporarily copying the file from the resources to the file system?

Hedge
  • 16,142
  • 42
  • 141
  • 246

1 Answers1

5

When you add a file to a resource, it's compiled into the final executable binary, so there is no concept of a file as there is in the filesystem, which is why lastModified doesn't return a value.

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85