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. [Solved]Loader with custom type
Forum Updated to NodeBB v4.3 + New Features

[Solved]Loader with custom type

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 893 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.
  • D Offline
    D Offline
    define_
    wrote on last edited by
    #1

    Startup element with a custom type error occurs:
    @CustomType is not a type@

    Loading item
    @
    Loader {
    id: loader
    source: "file:///home/user/MainSettings.qml"
    }
    @

    MainSettings.qml

    @
    import QtQuick 2.3
    Item {
    property QtObject delegates: Item {
    property var rect: Rectangle {color: "red"}
    property var flip: CustomType {}
    }
    }
    @

    CustomType.qml
    @ Item {

    }
    @

    MainSettings.qml is separate from the project

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I suspect you need to import "home/user" folder, otherwise the Loader does not know where to look for CustomType.

      (Z(:^

      1 Reply Last reply
      0
      • D Offline
        D Offline
        define_
        wrote on last edited by
        #3

        [quote author="sierdzio" date="1406623459"]I suspect you need to import "home/user" folder, otherwise the Loader does not know where to look for CustomType.[/quote]

        Yes, because the files are located in the resource, need to import as:
        @import "qrc:///qml"@

        thx.

        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