Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-28586

not all qt enums declared with Q_ENUMS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 4.8.4, 5.0.0 RC 1
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None

      Description

      Low prio but would probably be such a tiny fix in qt source and would greatly simplify our code.

      The problem is that some of the enums in qt5/qtbase/src/corelib/global/qnamespace.h are not declared with Q_ENUMS.

      This means that, for example, they are not exposed to qml. We can, for example, say in qml:

      Qt.Key_Backspace
      Qt.Key_C
      

      (because there is "Q_ENUMS(Key)" in qnamespace.h), but trying to say

      Qt.ShiftModifier
      

      ends up with an error. This means that we basically end up with a number of new enums in our qml, which then can be used e.g. in calls to our c++ functions which ... map them back to qt enum to call qt functions (such as KeyEvent constructor).

      Not a huge problem but duplicated enums and the mapping in our code would not be needed if only qt source contained "Q_ENUMS(KeyboardModifier)" (and similar declarations for other enums).

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            wiecko Marek Wieckowski
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes