Getting the version of Qt libraries

Last edited on

Overview

Because of the Requirements of Squish for Qt it is important to find out which version of the Qt libraries are being used by the application that should be automated. (This information is required to choose the matching Squish for Qt package.)

Mac OS X

Using “strings”

Example Terminal/shell command:

strings /Applications/MyApp.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore | grep "4\."

Example output:

4.7.1 qt_prfxpath=/usr/local/Trolltech/Qt-4.7.1-sqlite qt_docspath=/usr/local/Trolltech/Qt-4.7.1-sqlite/doc […]

Using “otool”

(otool is possibly only available after installation of Xcode.)

Example command in Terminal/shell:

otool -L /Applications/MyApp.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore

Example output:

/Applications/MyApp.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore: @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.1) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) […]

Linux & Unix

Using “strings”

Example shell command:

strings libQtCore.so.4 | grep "4\."

Example output:

4.7.1 qt_prfxpath=/usr/local/Trolltech/Qt-4.7.1-sqlite qt_docspath=/usr/local/Trolltech/Qt-4.7.1-sqlite/doc […]

Windows

Windows Explorer file properties

The properties dialog of a file (right mouse click, choose Properties) often contains the version information:

Windows Explorer info tooltip

Hovering the mouse over a file sometimes opens a tooltip with version information too:

Using “find”

Example shell/command prompt command:

find "4." "C:\Program Files\MyApp\QtCore4.dll"

Example output:

———- QTCORE4.DLL 4.6.0 qt_demopath=Q:/MinGW/x86/4.6.0/demos qt_xmplpath=Q:/MinGW/x86/4.6.0/examples […]