papyros / qml-material

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

module "Material" is not installed and make error #423

Open Alexorleon opened 8 years ago

Alexorleon commented 8 years ago

Hello.

I created an empty project. Qt 5.6, Ubuntu x64. Added the submodule: git submodule add https://github.com/papyros/qml-material.git material

Added the .pri file to project and included OPTIONS += roboto.

TEMPLATE = app
QT += qml quick
CONFIG += c++11

SOURCES += main.cpp
RESOURCES += qml.qrc
QML_IMPORT_PATH =

OPTIONS += roboto

include(deployment.pri)
include(material/material.pri)

Added import Material 0.2

import QtQuick 2.6
import Material 0.2

ApplicationWindow {
    id: mainWindow
    width: 640
    height: 360

    Button {
        text: "Button"
    }
}

But nothing works.

QQmlApplicationEngine failed to load component qrc:/qml/main.qml:2 module "Material" is not installed

I did this: mkdir build // ok cd build // ok qmake .. // ok, after installing some libraries (quick, qml) make // error

In file included from ../material/src/plugin.cpp:15:0: ../material/src/core/device.h:45:22: error: ISO C++ forbids declaration of ‘Q_ENUM’ with no type [-fpermissive] Q_ENUM(FormFactor) ^ ../material/src/core/device.h:45:22: error: expected ‘;’ at end of member declaration make: *\ [plugin.o] Error 1

This is a bug or am I doing something wrong?

sk2212 commented 8 years ago

Maybe you should add "QMAKE_CXXFLAGS += --std=gnu++11" in your pro file and also add the lines

QQmlApplicationEngine engine;
engine.addImportPath("qrc:/");

within your "main.cpp" file to make the Material plugin available.

khalili-mahdi commented 5 years ago

i have same problem , designer shows controls perfectly but in running i get "module "Material" is not installed"