Here is what you need to add to your Qt qmake projects to be able to add and use OpenCV 3.4.1 default set of libraries. I usually add them into a separate *.pri file and include that in my *.pro files to avoid repetition, but that’s up to you. Well, here it is:
Continue reading “Adding Required Includes and Libs for OpenCV 3.4.1 in qmake Projects”How to Get Current App Version in Qt
I have tried numerous methods to get an application’s own version number and believe me this is the best way to get it. First of all if we consider the fact that setting a Qt application version is done in PRO file (qmake) using the following simple command:
VERSION = 1.2.3.4
Then getting this same value should be the easiest possible method.
Just add the following line to your PRO file after defining version as seen above and you can use the same version string wherever you like in the code:
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
APP_VERSION will contain the string “1.2.3.4” and can be used in the C++ code.
How to Configure Qt to Use OpenCV Static Build in Linux
First of all I assume you have seen this post which describes how to build opencv statically for Linux. If that is the case then you can just add the following code to your qmake .PRO file to use opencv with Qt.
unix: {
CONFIG += link_pkgconfig
PKGCONFIG += opencv
}
How to Configure a Single Qt Project for Different Operating Systems
There are many cases in every cross-platform development framework that you want your source code to be built differently under different operating systems. For example you might want a method to to use platform specific functions in Windows, Linux and Mac OS X but you don’t want to have different projects for each one of them. If you are in a similar situation then you can use the following approach to have a single integrated project for all operating systems that you are developing for.
Continue reading “How to Configure a Single Qt Project for Different Operating Systems”