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. QDeclarativeListProperty unregistered datatype error

QDeclarativeListProperty unregistered datatype error

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.6k 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.
  • K Offline
    K Offline
    kernco
    wrote on last edited by
    #1

    I'm trying to use QDeclarativeListProperty so that in QML I can use a Repeater in a Column to create a QML Item for each object in a QList. I've just copied what was done in the Minehunt demo (http://qt-project.org/doc/qt-4.8/demos-declarative-minehunt.html ) and changed TileData to my own Element class, but when I try to run the program, I get this error:
    @QMetaProperty::read: Unable to handle unregistered datatype 'QDeclarativeListProperty<Element>' for property 'Game::elements'@

    I can't figure out why it's an unregistered datatype. I don't see anywhere in the Minehunt demo where anything is done to register their datatypes. What would cause this error? Both Game and Element inherit from QObject, just like TileData and MinehuntGame do in the demo.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chriadam
      wrote on last edited by
      #2

      In "main.cpp":http://qt-project.org/doc/qt-4.8/demos-declarative-minehunt-main-cpp.html of the minehunt demo, it does register TileData as a QML object type. Although I'm not sure if that is what allows the QDeclarativeListProperty<TileData> to be registered automatically by the engine... QDLP has some quirks.

      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