Qt Creator 设置
**Default build directory: **
./tmp/%{CurrentBuild:Name}
Material 源码
Git:
https://github.com/papyros/qml-material.git
https://github.com/benevo-qml/qml-material.git
Material编译
1、修改papyros\qml-material.git\src目录下的src.pro文件
为:
(...省略..)
styles.files += styles/*
styles.path = $$[QT_INSTALL_QML]/QtQuick/Controls/Styles/Material
#qmldir.target = $$OUT_PWD/out/qmldir
#qmldir.commands = mkdir -p $$OUT_PWD/out;
#qmldir.commands += sed \"s/$$LITERAL_HASH plugin material/plugin material/\" $$PWD/qmldir > $$qmldir.target
#qmldir.depends = $$PWD/qmldir
qmldir.path = $$[QT_INSTALL_QML]/Material
qmldir.files = $$PWD/qmldir
qmldir.CONFIG += no_check_exist
INSTALLS += target material extras listitems styles qmldir
OTHER_FILES += $$material.files $$extras.files $$listitems.files $$styles.files
然后,项目切换到release模式下,按如下进行配置
一共两处:
1、 nmake install,将Material插件安装到qt的qml插件目录下
Command: nmake
Arguments: install
2、 qmlplugindump,在插件的安装目录下自动生成.qmltypes
Command: qmlplugindump
Arguments: -nonrelocatable Material 0.3 %{CurrentProject:QT_HOST_BINS}/../qml/Material > %{CurrentProject:QT_HOST_BINS}/../qml/Material/plugin.qmltypes
最后,按下build按钮,即可。
Material使用
在qml文件中加入以下行即可
import Material 0.3