QML添加导入路径问题
给QML做导入包 提示:“module "Projects.MyFunctions" is not installed ”
尝试了http://blog.csdn.net/chenlong12580/article/details/8624216中的2中方法都为成功
方法一:在main.cpp中使用addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), QString::fromLatin1("qml")))
方法二:在pro中添加QML2_IMPORT_PATH宏并指定相应的路径
下面是我qmldir内容:
module Projects.MyFunctions
CustStatesFunc 1.0 CustStatesFunc.js
Func 1.0 func.js
Variable 1.0 variable.js
在qml中是这么使用的:import Projects.MyFunctions 1.0
各位大牛给点指点是还需要什么其他的指定还是我使用上有错误?