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

Provide qtquickcontrols2.conf file options for attached properties that must be specified often

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • None
    • Quick: Controls 2
    • None

    Description

      In my project, the delay and timeout for tooltip are the same for each control, but must be specified across several files. I currently have properties in main.qml, which are used by every other QML file:

          ToolTip.text: qsTr("Click to choose the path to a tileset image")
          ToolTip.visible: hovered
          ToolTip.delay: toolTipDelay
          ToolTip.timeout: toolTipTimeout
      

      Since attached types can't be extended, I can't move these properties into e.g. MyToolTip and then reuse that component everywhere. It would be nice to be able to set the default delay and timeout in the qtquickcontrols2.conf file. Something like this (I forget how the syntax works):

      [Controls]
      Style=Material
      ToolTip\delay=500
      ToolTip\timeout=1000
      

      Attachments

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes