Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-8737

ComboBox: Ability to define separate text/display role for enum values

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • QDS 4.2
    • None
    • Property View
    • None
    • 3b8c38c7f (qds/dev)
    • QDS Berlin - 2023 Week 9/10, QDS Berlin - 2023 Week 11/12, QDS Berlin - 2023 Week 13/14, QDS Berlin - 2023 Week 15/16, QDS Berlin - 2023 Week 17/18

      When adding ComboBox property editors for selecting an Enum value for a property, the actual value of the enum must be used.  So you would set the "scope" for the class Type, and then the Values are the actual names of the enums.  This doesn't always make sense because the Developer enum names are sometimes not very display friendly (due to naming policies etc).

      When using Qt Quick Control's ComboBox it is possible to do something like the following instead:

       

      model: [
          { value: SceneEnvironment.NoAA, text: "No Antialiasing"},
          { value: SceneEnvironment.SSAA, text: "Supersample AA"},
          { value: SceneEnvironment.MSAA, text: "Multisample AA"},
          { value: SceneEnvironment.ProgressiveAA, text: "Progressive AA"}
      ]
       

      Which means that what is shown to the user is more descriptive (and potentially translatable), but we still can use the underlaying value when getting/setting the property. 

      The DS HelperWidget ComboBox should also have such a Display/Text role, as this will help improve user experience for Enum values in the property view. 

       

        For Gerrit Dashboard: QDS-8737
        # Subject Branch Project Status CR V

            henning Henning Gründl
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes