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. Cannot pass enum value as signal parameter from C++ to QML
Forum Update on Monday, May 27th 2025

Cannot pass enum value as signal parameter from C++ to QML

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 3.1k 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.
  • V Offline
    V Offline
    vishwajeet
    wrote on 31 Mar 2011, 05:30 last edited by
    #1

    When an ImageViewer::Status value is emitted from C++, it is received in the QML signal as a QVariant(ImageViewer::Status) value, instead of the actual enum value.

    The enum has already been registered using:

    Q_ENUMS
    Q_DECLARE_METATYPE (as ImageViewer::Status)
    qRegisterMetaType (as ImageViewer::Status)

    If you have faced same issue then please vote to raise priority of this issue in http://bugreports.qt.nokia.com/browse/QTBUG-15983

    Born To Code !!!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mario
      wrote on 31 Mar 2011, 07:07 last edited by
      #2

      I have no idea if this works, but have you checked the "QDeclarativeEngine":http://doc.qt.nokia.com/4.7/qdeclarativeengine.html docs, especially "QML_DECLARE_TYPE":http://doc.qt.nokia.com/4.7/qdeclarativeengine.html#QML_DECLARE_TYPE

      Can that be to any help?

      1 Reply Last reply
      0

      1/2

      31 Mar 2011, 05:30

      • Login

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