papyros / qml-material

:book: Material Design implemented in QtQuick
GNU Lesser General Public License v2.1
2.57k stars 476 forks source link

Enhance installation documentation / Help newcomer use/build qml-material #409

Open ronjouch opened 8 years ago

ronjouch commented 8 years ago

Hi, this is a followup to a gitter discussion.

I'm a newcomer to qml-material and am struggling with using/building it. When trying to use qml-material in my own qtquick1 application following the Per-project installation using git submodules and trying various ways to bundle/import it (qmldir-based import Material 0.2, qrc-style import "qrc:/Material"), I was getting the same Module "Material" is not installed as other users reported on GitHub/Gitter/SO.

From looking at the doc and issue reports, I understood that #137 is outdated because 0.1's project structure changed (no more single modules folder), so its former solution is no longer valid for ≥ 0.2. I remained unsure of whether I needed to addImportPath() anything. Then I got help on your Gitter channel:

→ Two things:

  1. Am I doing something wrong causing me to require manual steps normally covered by just following the doc (including material.pri)? If not, should I propose a doc PR including these instructions be part of the installation guide?
  2. Within QtCreator I see my import Material 0.3 statement highlighted in red, and my usages of Material components (e.g. ActionButton {}) appear unrecognized/un-colored by QtCreator. Is there a way to fix this?
    • @voidware suggested I add a QML_IMPORT_PATH += external/material/src/components external/material/src/controls ... line to my .pro, but that didn't seem to help and I'm confused about this variable, which I may be mixing with QML2_IMPORT_PATH. Again, should everything work after including material.pri, or can I help enhance the documentation?
    • EDIT 2016-04-13 @oKcerG said on Gitter: _"yes it has nothing to do with QML2_IMPORT_PATH, it’s just to help QtCreator do its autocompletion; however I just realized it’s not really compatible with the new structure since it doesn’t follow the module import structure"_

Halp :worried: . I'm running the latest qml-material 0cada50ee5469efdeb37e9eb2f5e8de0194b6ba6 on branch develop on Qt 5.6.0 on Ubuntu 14.04.4LTS x64, feel free to ask for additional debug info. The project looks great, thanks for the work, can't wait to try it.

majuca commented 8 years ago

Hi, it's not necessary to include a .pri or to register Material type in your project. What you need, is to add a Make build step in qtcreator for the qml-material project to install the Material plugin at the end of the build. This step will do "make install". This last will copy qml and material plugin to be available for your project.

After that, you only need to add in your qml files:

import Material 0.3 import Material.ListItems 0.1 as ListItem import Material.Extras 0.1

voidware commented 8 years ago

right now, the installer for Material winds up in the Qt directory. Are you saying it would copy these from here into my project? Suppose i want the Material QML as resources?

ronjouch commented 8 years ago

If correct, the doc patch above should fix point 1. (document registration steps).

I'm still unsure about point 2. (how to un-confuse QtCreator), feedback welcome.

majuca commented 8 years ago

Hi,

The file material.pri should contain:

INCLUDEPATH += $$PWD/src