Skip to content

Building RoniaKIT with qmake #17

@DirkOlhaiser

Description

@DirkOlhaiser

Hello,

I am using you library (Very beautiful, Thanks :) ) in a qmake application (qt 6.6.3).

I had to make minor changes in order to get it working. Here's what I had to do. Maybe you can make a small chapter on what to set up in order to use your library.

  1. Create a subfolder in your project directroy (For example RoniaKit) and copy the contents from the resources folder into it.
  2. Create a new qmldir file in the RoniaKit folder.
  3. Open your resource file (qml.qrc) and add a new Prefix with the name /RoniaKit. If you named the new subfolder differently, name the prefix accordingly. Otherwise qmake will not recognise the module!
  4. Add all the files from RoniaKit subfolder to the new prefix in the resource file
  5. Create the module and add all qml files to the qmldir file:
module RoniaKit
HalfDial 1.0 Components/Gauges/HalfDial.qml
Thermometer 1.0 Components/Gauges/Thermometer.qml
...
  1. Add the module to your qt engine:
    engine.addImportPath("qrc:/RoniaKit");
  2. Add the path to the qml import path in your *.pro file: QML_IMPORT_PATH += $$PWD/RoniaKit
  3. Everytime a resource file is loaded (font, picture, etc.) the path is not correctly set up. Insted of source: "qrc:/RoniaKit/resources/..., source: "qrc:/RoniaKit/RoniaKit/... must be used. The issue is that qml doesn't load the module if the prefix is /RonialKit and the qmldir file is in /resources. Maybe there is another way but I didn't figure it out.

Follwing these steps, you can use the components in your qmake application by using import RoniaKit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions