I would like to know if it is possible to create a Qt application that uses the qt5 version of core library and the qt4 version of the gui library. I would like to use some features available only in qt5, like the QCommandLineParser class, but it is not possible for me to use qt5gui, only the qt4 version is working.
No that's not possible, you can't link an application with mixed versions of Qt, actually you can't even compile it.. if you need something very specific you can extract from the code, but you need a commercial license for this.