I'm on Ubuntu 14.04 and have both qt4 and qt5 installed (from the repositories). I thought I could switch between building with qt5 to building with qt4 simply with
sudo apt-get install qt4-default
But the program still builds with Qt5 and gives error because it only supports Qt4.
I checked the qmake version and after qt4-default is installed it gives
$ qmake --version
QMake version 2.01a
Using Qt version 4.8.6 in /usr/lib/x86_64-linux-gnu
I'm building with CMake in case that is useful. Also, if I do
sudo apt-get remove qtbase5-dev
then finally it builds with qt4.
EDIT: I am not using Qt Creator and would prefer a command-line solution