2014-11-24 47 views
2

我对使用QT5的Qt Quick Components for Desktop有一些安装问题。QT5-安装用于桌面的Qt Quick Components

以下是我所遵循的步骤(基于these instructions):

  1. http://qt.gitorious.org/qt-components/desktop/trees/master下载tar.gz的,和解压的组件。

  2. 加入到环境变量PATH变量值(OS:Windows 8中)C:\Qt\Qt5.3.1\5.3\msvc2012_opengl\bin;C:\Qt\Qt5.3.1\Tools\QtCreator\bin;

  3. 运行vcvars32.bat脚本(的Visual Studio 2012)。

  4. 运行命令:qmake && nmake install\qt-components-desktop\components文件夹中。

  5. 运行命令:qmake && nmake install\qt-components-desktop\src文件夹中。该命令已自动将已编译的组件文件复制到QT导入文件夹。

在步骤,我得到了这些错误:

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. 

据我所知,在发生这些错误,因为源代码是QT4,这其中就包括减速(如QtGui/QApplication)没有在QT5中存在时间更长。

我google了很多,但我找不到如何下载QT5的插件,如QT4的http://qt.gitorious.org/qt-components/desktop/trees/master

有什么想法?或者也许还有另一个我错过的问题?

回答

2

我发现替代组件在QT5:

根据this wikiQt Quick Controls取代了以前的一个Qt Desktop Components。因此,在将QT4.x的QML代码移植到QT5.x时,如果要使用这些组件,则需要用import QtQuick.Controls *version*替代QML文件中的import Qt.labs.components *version*

希望这会帮助别人......