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

Design studio property editor qml generator

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • 6.x
    • None
    • QML: Tooling

    Description

      Generator that outputs a modules UI layout files (specifics & section files) for the property editor. The generator reads a modules .qmltypes file and outputs the boilerplate UI layout. This output should then be manually inspected and tweaked.

      This is was normally done manually for every variable in a module. Adjusting the general property editor UI layout will take a long time when done manually.

      Design studio's property editor has two files, specifics and section.

      Example of CustomMaterialSpecifics.qml

      Column { 
          width: parent.width  
          CustomMaterialSection { 
              width: parent.width 
          }
          MaterialSection {
              width: parent.width
          }
      } 
      

      Example of custom material variable in CustomMaterialSection.qml

      Section {
          caption: qsTr("Custom Material")
          width: parent.width
      
          SectionLayout {
              PropertyLabel {
                  text: qsTr("Shading Mode")
                  tooltip: qsTr("Specifies the type of the material.")
              }
      
              SecondColumnLayout {
                  ComboBox {
                      scope: "CustomMaterial"
                      model: ["Unshaded", "Shaded"]
                      backendValue: backendValues.shadingMode
                      implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                     + StudioTheme.Values.actionIndicatorWidth
                  }
      
                  ExpandingSpacer {}
               }
          }
      }
      

      The generator will create these files and will output the examples given above. It will fill the 'scope' and 'model' automatically if the data is available in the modules .qmltypes file.
      The tooltip will also be automatically extracted from the module's source files.

      Most of the needed code can be automatically generated from the .qmltypes and source files. All of the information is not available for the generator like default value, min and max values. This is why the output should be manually inspected and the missing information filled.

      Having access to this generator will make implementing a module to design studio faster and easier.

      Attachments

        For Gerrit Dashboard: QTBUG-99536
        # Subject Branch Project Status CR V

        Activity

          People

            thohartm Thomas Hartmann
            tonyl Tony Leinonen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change