lirios / fluid

:book: Library for QtQuick apps with Material Design
https://docs.liri.io/sdk/fluid/develop/
Other
812 stars 112 forks source link

Unable to use Fluid in QtCreator on Linux #256

Open daljit97 opened 6 years ago

daljit97 commented 6 years ago

I cannot seem to make Fluid work inside my project. I have cloned Fluid inside my project folder, then I used INCLUDEPATH and QML2_IMPORT_PATH to include the necessary folders. I also tried with qputenv("QML2_IMPORT_PATH", "fluid/qml"), but nothing works (I always get Fluid.Controls is not installed). I am on Linux. I have checked the previous issues on this topic but none of them seems to work.

obeezzy commented 6 years ago

@daljit97 , have you tried "make install"?

daljit97 commented 6 years ago

Ok so I did that and then I added all the fluid/qml files into the qrc of my app. But now I get the following error:

QQmlApplicationEngine failed to load component
qrc:/main.qml:3 module "Fluid.Controls" plugin "fluidcontrolsplugin" not found
luntik2012 commented 6 years ago

Could you show full project?

You can try to use qbs.

Example

```qbs // ras.qbs import qbs import qbs.FileInfo Project { minimumQbsVersion: "1.7.1" CppApplication { Depends { name: "Qt" submodules: [ "core", "quick", "gui", "quickcontrols2", "sql", "widgets", "multimedia", "qml", "opengl", "concurrent" ] } Depends { name: "lirideployment" } name: "ras" property pathList qmlImportPaths: [ FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, lirideployment.qmlDir), sourceDirectory ] cpp.cxxLanguageVersion: "c++11" cpp.includePaths: [ "cpp", "cpp/goodies", "cpp/wrappers", "cpp/models", ] cpp.defines: [ "USE_QML" ] files: [ "cpp/*.cpp", "cpp/*.h", "cpp/goodies/*.cpp", "cpp/goodies/*.h", "cpp/models/*.cpp", "cpp/models/*.h", "cpp/wrappers/*.cpp", "cpp/wrappers/*.h", "*.qrc", ] qbsSearchPaths: [ "third_party/fluid/qbs/shared", "third_party/fluid/qbs/local" ] // Properties for the produced executable Group { fileTagsFilter: "application" qbs.install: true } } SubProject { filePath: "third_party/fluid/fluid.qbs" Properties { withDocumentation: false withDemo: false autotestEnabled: false } } } ``` .gitmodules ```git [submodule "third_party/fluid"] path = third_party/fluid url = https://github.com/lirios/fluid/ ```

daljit97 commented 6 years ago

@luntik2012 is qbs supported on Android?

edips commented 6 years ago

AFAIK qbs doesn't work for Android. To install Fluid for Android:

export ANDROID_NDK_ROOT=/home/.../android-ndk-r10e
cd fluid
mkdir build && cd build
<path/to/qt>/<android-kit>/bin/qmake ../fluid.pro CONFIG+=install_under_qt
make
make install
plfiorini commented 6 years ago

Unfortunately qbs doesn't provide the *deployqt features yet. In the future I would like to see if I can at least wrap androiddeployqt and solve that temporarily, until qbs provides a solution itself.

plfiorini commented 6 years ago

@daljit97 Did you see the example on how to integrate Fluid in your qmake project? See https://github.com/lirios/fluid/tree/develop/examples/perproject/minimalqmake

DevDorrejo commented 5 years ago

Ok so I did that and then I added all the fluid/qml files into the qrc of my app. But now I get the following error:

QQmlApplicationEngine failed to load component
qrc:/main.qml:3 module "Fluid.Controls" plugin "fluidcontrolsplugin" not found

That error appear because you don't have one of the dependencies installed:

https://github.com/lirios/cmake-shared