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

Function overloading with date related methods fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.6.0, 6.6
    • 6.5
    • QML: Compiler
    • c108a817f (dev), 330c3e91e (dev), 5bc63de88 (dev), bda7b2a44 (dev), c09e2d919 (6.5), 3c1b81726 (6.5), c7f5507f0 (6.5)

    Description

      Compiling

      import QtQuick
      
      Window {
          id: win
          width: 640
          height: 480
          visible: true
          title: "Sandbox"
      
          property date date: ""
      
              Text {
                  text: Qt.formatTime(win.date)
              }
          }
      }
      

      runs into

      Warning: main.qml:37:22: Could not compile binding for text: No matching override found. Candidates:
      argument 0 contains QDateTime of (component in /home/prcs1076/tmp/build-untitled-Dev_Snapshot-Debug/main.qml)::date with type QDateTime but is expected to contain the type QString
      Function expects 2 arguments, but 1 were provided
      Function expects 3 arguments, but 1 were provided
      argument 0 contains QDateTime of (component in /home/prcs1076/tmp/build-untitled-Dev_Snapshot-Debug/main.qml)::date with type QDateTime but is expected to contain the type QTime
      Function expects 2 arguments, but 1 were provided
      Function expects 3 arguments, but 1 were provided
      Function expects 2 arguments, but 1 were provided
      Function expects 2 arguments, but 1 were provided
      Function expects 2 arguments, but 1 were provided
      Function expects 2 arguments, but 1 were provided [compiler]
                  text: Qt.formatTime(win.date)
                           ^^^^^^^^^^

      . Same for data types passed from C++.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: