2

How to get the file version from File properties\Details\File version in Qt?

I didn't find it in QFileInfo.

altocumulus
  • 21,179
  • 13
  • 61
  • 84
Hurr
  • 55
  • 1
  • 8
  • Which kind of files are you referring to? – vahancho Apr 07 '16 at 10:45
  • 1
    There is not general property for files called 'file version'. It has to do with specific type which has that property. – Meena Alfons Apr 07 '16 at 10:50
  • I work with *.dll files. – Hurr Apr 07 '16 at 10:56
  • 2
    I seriously doubt there is such functionality in Qt. Here is Win32 API solution: [click](http://stackoverflow.com/questions/940707/how-do-i-programatically-get-the-version-of-a-dll-or-exe-file). Not all DLLs contain version info. – Ivan Aksamentov - Drop Apr 07 '16 at 11:00
  • @Drop sounds like you've answered the question. Maybe you could type that up? – Jonathan Mee Apr 07 '16 at 11:15
  • @Hurr In the end, how did you do it? Does it work cross-platform, or, at least, does interfere ? (it would be nice to work with QCoreApplication::applicationVersion()) – Liviu Apr 03 '17 at 09:11
  • you can get the current qt version with qVersion() from , there also is QLibraryInfo::version(), see doc of QtGlobal and QLibraryInfo – user2019716 Sep 15 '21 at 16:21

1 Answers1

3

This is not implemented in Qt. You can find an example of how to do it integrated with Qt here.

Serafim Costa
  • 1,918
  • 1
  • 16
  • 18