QT5- Installing Qt Quick Components for Desktop

1k views Asked by At

I have some installation issues with the Qt Quick Components for Desktop, using QT5.

Following are the steps I have followed (based on these instructions):

  1. Downloaded the tar.gz from http://qt.gitorious.org/qt-components/desktop/trees/master, and unpacked the components.

  2. Added to PATH variable value in the environment variables (OS : Windows 8) C:\Qt\Qt5.3.1\5.3\msvc2012_opengl\bin;C:\Qt\Qt5.3.1\Tools\QtCreator\bin;

  3. Run the vcvars32.bat script (Visual Studio 2012).

  4. Ran the command: qmake && nmake install in \qt-components-desktop\components folder.

  5. Ran the command: qmake && nmake install in \qt-components-desktop\src folder. This command has automatically copied the compiled component files to QT import folder.

During step 5, I got these errors:

fatal error C1083: Cannot open include file: 'QtGui/qmenu.h': No such file or directory
fatal error C1083: Cannot open include file: 'QtGui/qmenu.h': No such file or directory
fatal error C1083: Cannot open include file: 'QtGui/qgraphicsitem.h': No such file or directory
fatal error C1083: Cannot open include file: 'QtGui/QStyle': No such file or directory
.\qdeclarativefolderlistmodel.cpp(162) : error C3861: 'setRoleNames': identifier not found
fatal error C1083: Cannot open include file: 'QtGui/QStyle': No such file or directory
fatal error C1083: Cannot open include file: 'QtGui/qgraphicssceneevent.h': No such file or directory
fatal error C1083: Cannot open include file: 'QtGui/QAction': No such file or directory
fatal error C1083: Cannot open include file: 'QtGui/QApplication': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.exe"' : return code '0x2' Stop.

I understand that these errors are occurred because the source code is for QT4, and these include deceleration (like QtGui/QApplication) are no longer exist in QT5.

I googled a lot, but I couldn't find how can I download this plugin for QT5, as in http://qt.gitorious.org/qt-components/desktop/trees/master for QT4.

Any idea? or maybe there is another issue that I missed?

1

There are 1 answers

0
user3114639 On BEST ANSWER

I found the alternative components in QT5:

according to this wiki, Qt Quick Controls replaced the former one Qt Desktop Components. So for using these components when porting QML code from QT4.x to QT5.x, you need to replace import Qt.labs.components *version*in your QML file with import QtQuick.Controls *version*.

Hope this will help someone...