Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. What's wrong with qml's importing?
Forum Updated to NodeBB v4.3 + New Features

What's wrong with qml's importing?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 771 Views
  • 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.
  • D Offline
    D Offline
    Deerenaros
    wrote on last edited by
    #1

    Okay, guys. Could you tell me, what's wrong with QML? Perfect idea, worst in implementation. Strange mixing C++ with QML (but easy enougth), interesting insertion of javascript, but buggy anyway, awesome auto-updating, but could not take any sort of control one. But there is another question.

    I'm trying to make my source tree better and prettier, but when i'm wokring with qml and qrc at same time awfull things are happens. I could not say how qml engine are search its files cause only magic workarounds are working. Stackoverflow is overflowed with questions kinda "QML do not import file from .qrc". And my question is like them, but I could not find answer myself.

    import QtQuick 2.0
    import QtQuick.Controls 2.0
    import QtQuick.Layouts 1.0
    
    import "FDR" as FDR
    import "NLD" as NLD
    import "Report" as Report
    
    GridLayout {
        id: deviceView
    
        /**********************/
        
        SwipeView {
            /**********************/
    
            NLD.main {
            }
    
            FDR.main {
            }
    
            Report.main {
            }
        }
    }
    

    Just do not works die to qrc:/resources/DeviceView.qml:133:13: Expected type name with such tree

    $ tree resources
    resources
    ├── Amplifier.qml
    ├── DevicesList.qml
    ├── DeviceView.qml
    ├── FDR
    │   ├── Controls.qml
    │   ├── main.qml
    │   ├── Plot.qml
    │   ├── qmldir
    │   └── Results.qml
    ├── functions
    │   └── helpers.js
    ├── images
    │   ├── st300.jpg
    │   └── Thumbs.db
    ├── main.qml
    ├── MultiText.qml
    ├── NLD
    │   ├── main.qml
    │   └── qmldir
    ├── OffMode.qml
    ├── Oscilloscope.qml
    ├── PairItem.qml
    ├── Pin.qml
    ├── PINSelector.qml
    ├── PinsResponse.qml
    ├── Receiver.qml
    ├── Report
    │   ├── main.qml
    │   └── qmldir
    ├── Settings.qml
    ├── StatusBar.qml
    ├── Switcher.qml
    ├── SwitchItem.qml
    └── TabBtn.qml
    

    Here is qml.qrc:

    <RCC>
        <qresource prefix="/">
            <file>resources/images/st300.jpg</file>
            <file>resources/functions/helpers.js</file>
            <!-- FDR -->
            <file>resources/FDR/main.qml</file>
            <file>resources/FDR/Plot.qml</file>
            <file>resources/FDR/Controls.qml</file>
            <file>resources/FDR/Results.qml</file>
            <file>resources/FDR/qmldir</file>
            <!-- NLD -->
            <file>resources/NLD/main.qml</file>
            <file>resources/NLD/qmldir</file>
            <!-- Report -->
            <file>resources/Report/main.qml</file>
            <file>resources/Report/qmldir</file>
            <file>resources/Amplifier.qml</file>
            <file>resources/DevicesList.qml</file>
            <file>resources/DeviceView.qml</file>
            <file>resources/OffMode.qml</file>
            <file>resources/Switcher.qml</file>
            <file>resources/Oscilloscope.qml</file>
            <file>resources/Settings.qml</file>
            <file>resources/Receiver.qml</file>
            <file>resources/SwitchItem.qml</file>
            <file>resources/StatusBar.qml</file>
            <file>resources/Pin.qml</file>
            <file>resources/MultiText.qml</file>
            <file>resources/TabBtn.qml</file>
            <file>resources/PairItem.qml</file>
            <file>resources/PINSelector.qml</file>
            <file>resources/PINsResponse.qml</file>
            <file>resources/main.qml</file>
        </qresource>
    </RCC>
    

    Whole project you can found at github (danger, project are on deep development state). Please, help. Save my soul, anybody.

    Thank you in advance!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Deerenaros
      wrote on last edited by
      #2

      Holy shit!

      Okay, this is rly strange, but changing main.qml's into Main.qml's helped me. Something completly broken inside qml, I guess.

      $ tree resources
      resources
      ├── Amplifier.qml
      ├── DevicesList.qml
      ├── DeviceView.qml
      ├── FDR
      │   ├── Controls.qml
      │   ├── Main.qml
      │   ├── Plot.qml
      │   ├── qmldir
      │   └── Results.qml
      ├── functions
      │   └── helpers.js
      ├── images
      │   ├── st300.jpg
      │   └── Thumbs.db
      ├── main.qml
      ├── MultiText.qml
      ├── NLD
      │   ├── Main.qml
      │   └── qmldir
      ├── OffMode.qml
      ├── Oscilloscope.qml
      ├── PairItem.qml
      ├── PairSelector.qml
      ├── Pin.qml
      ├── PinsResponse.qml
      ├── Receiver.qml
      ├── Report
      │   ├── Main.qml
      │   └── qmldir
      ├── Settings.qml
      ├── StatusBar.qml
      ├── Switcher.qml
      ├── SwitchItem.qml
      └── TabBtn.qml
      
      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