Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. how to add qml files of an upper directory to qrc (../src/qmlfiles) ?
Forum Updated to NodeBB v4.3 + New Features

how to add qml files of an upper directory to qrc (../src/qmlfiles) ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 408 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    themts
    wrote on last edited by themts
    #1

    Hey guys,

    I have a directory-structure like this:

    MyProject
    ├─ MyProject.pro
    ├─ defaults.pri
    ├─ apps/
    │  ├─ apps.pro
    │  ├─ app1/
    │  └─ app2/
    │      ├─ app2.pro
    │      └─ main.cpp
    ├─ src/
    │  ├─ class1.cpp
    │  ├─ class2.cpp
    │  └─ qmlfiles/
    │       ├─ Button1.qml
    │       └─ Button2.qml
    └─ tests/
       ├─ tests.pro
       └─ main.cpp
    

    Lets say I'm in app.pro:
    When I add button1.qml to qml.qrc it will look like this:

    ../../src/qmlfiles/Button1.qml
    

    Now I want to add this button to main.qml, so I import it like this:

    import "../../src/qmlfiles/"
    

    No problems so far. Qt Designer even shows the button as expected.
    As soon as I start my application it says

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:4 "../../src/qmlfiles/": no such directory
    

    Any idea how I can solve this problem?

    CU
    mts

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved