1 | initial version |
This problem was caused on Ubuntu 13.04 where qtcreator does not detect the qt5 installation. When I built OpenCV the OpenCV build correctly picked up the qt5 installation. When I started the Qt project (in my case OpenCVNQt) with qtcreator only qmake-qt4 was detected. So the problem I saw was a result of a mismatch between Qt5 libraries used in OpenCV and Qt4 libraries used in my project. To fix this I had to delete the Qt project OpenCVNQt.pro.user file and manual add /usr/lib/x86_64-linux-gnu/qt5/bin/qmake ({Tools->Options; Build & Run; Qt Versions} See http://askubuntu.com/questions/279421/how-can-i-install-qt-5-x-on-12-04-lts). Also you have to manual add the Qt5 Kit ({Tools->Options; Build & Run; Kits}). Then I updated the project code, in particular I had to add QT += widgets to the OpenCVNQt.pro file and change #include <qtgui> to #include <qtwidgets> (see http://qt-project.org/doc/qt-5.0/qtdoc/portingguide.html).
Now it works!