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 cast to type QMap<QString, QVariant>
Forum Updated to NodeBB v4.3 + New Features

How to cast to type QMap<QString, QVariant>

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

    How can I cast QMap<QString, QObject*> to QMap<QString, QVariant> ??

    casting to QMap in general doesn't seem to work.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You can't. The only solution I came to would be to manually copy the contents of the one type to the other type.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hachaso
        wrote on last edited by
        #3

        Do you know how to expose the QMap<QString, QObject*> to QML ?

        Can't seem to get it to work properly

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          There should be some means, if I recall correctly. I don't know the details, sorry.

          http://www.catb.org/~esr/faqs/smart-questions.html

          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