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 create QML enumeration like those of Qt QML type?
Forum Updated to NodeBB v4.3 + New Features

How to create QML enumeration like those of Qt QML type?

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

    How to create QML enumeration? As we know Qt type have so many enumeration such as Qt.Key_Left. I want to create a custom enumeration like that.

    @SomeClass
    {
    property enumeration type: SomeClass.EnumerationValue
    }@

    1 Reply Last reply
    1
    • GianlucaG Offline
      GianlucaG Offline
      Gianluca
      wrote on last edited by
      #2

      For doing that:

      • create a subclass of QObject,
      • add an enum declaration,
      • declare it using Q_ENUM and
      • register the object with qmlRegisterType
      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