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

Invalid argument passed to formatTime

    XMLWordPrintable

Details

    • c09e2d91989fec4455fa3bbd23bbd4bed6a01d77

    Description

      This code works when using qt_add_executable and resources (qtbug113808-old.zip), but not qt_add_qml_module (qtbug113808-new.zip):

      import QtQuick
      import QtQuick.Controls.Fusion
      
      ApplicationWindow {
          id: root
          width: 640
          height: 480
          visible: true
          title: Qt.formatTime(root.time, "hh")
      
          property var time: new Date(1970, 1, 1, 0, 0)
      }
      

      The fact that this doesn't work blocks https://codereview.qt-project.org/c/qt/qtdeclarative/+/470153 and https://codereview.qt-project.org/c/qt/qtdeclarative/+/470154 from being merged to 6.5.

      https://doc.qt.io/qt-6/qml-qtqml-qt.html#formatTime-method says:

      The time parameter may be a JavaScript Date object, a QTime, or QDateTime value.

      In dev, the example works: https://codereview.qt-project.org/c/qt/qtdeclarative/+/470154/1#message-df1b6f66bfa4a02d08a49880841ba3b5b56ebedf

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes