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

qmllint: warning about mousePressAndHoldInterval property of Qt.styleHints

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 6.5.2, 6.6.0 Beta2
    • QML: Tooling
    • None

    Description

      After fixing most application side qmllint warnings in a project, there are still some left that originate from Qt itself. This a minimal example containing all the triggers.

      While creating this issue, I've found that most of the issues were already reported in some way, but I think this one remains:

      • Member "mousePressAndHoldInterval" not found on type "QObject" [missing-property]

      My guess is that this might be due to using a covariant return type:

      QStyleHints *QQuickGuiProvider::styleHints() override

      whereas it is QObject in the virtual base class method:

      QObject *QQmlGuiProvider::styleHints()

      Other warnings already reported (for the records):

      • Cannot assign literal of type double to QQmlScriptString [incompatible-type] => looks a little bit like QTBUG-101364
      • Type QEventPoint of parameter called eventPoint in signal called tapped required by the compilation of onTapped cannot be used. [signal-handler-parameters] => also reported in QTBUG-115439
      • Member "monthName" not found on type "QLocale" [missing-property] => also reported in QTBUG-112364
      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      
      Window {
          id: root
      
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Button {
              id: button
      
              // qmllint: Member "monthName" not found on type "QLocale" [missing-property]
              text: Qt.locale().monthName(5, Locale.LongFormat)
      
              hoverEnabled: true
      
              // qmllint: Member "mousePressAndHoldInterval" not found on type "QObject" [missing-property]
              ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
              ToolTip.timeout: 2500
              ToolTip.visible: hovered
              ToolTip.text: "Tooltip"
          }
      
          Item {
              id: fooItem
      
              states: State {
                name: "foo"
                ParentChange {
                  target: fooItem
                  parent: button
                  // qmllint: Cannot assign literal of type double to QQmlScriptString [incompatible-type]
                  width: 100
                  height: 100
                  x: 0
                  y: 0
                }
              }
          }
      
          TapHandler {
            // qmllint: Type QEventPoint of parameter called eventPoint in signal called tapped required by the compilation of onTapped cannot be used.  [signal-handler-parameters]
            onTapped: console.log("tapped")
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              njeisecke Nils Jeisecke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes