Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-29005

QML debugger does not support JavaScript Map object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 9.0.2
    • Debugger
    • None
    • MacOS (M1) 12.6; Qt 6.4.2
    • macOS

    Description

      Qt JavaScript supports Map object which was introduced in ECMAScript 6, but the debugger does not.

      I created a minimal project (QtQuick project) with main.qml:

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Component.onCompleted:
          {
              let myMap = new Map()
              myMap.set(12, "Apple")
              myMap.set(4, "Orange")
              myMap.set(5, "Banana")
              console.log(myMap.has(4))
              myMap.delete(4)
              console.log(myMap.has(4))
              let fruit = myMap.get(12)
              console.log(fruit)
          }
      }
       

      This correctly produced the output:

      qml: true
      qml: false
      qml: Apple 

      However the debugger only ever showed `myMap` as "object" without allowing inspection of its size or contents:

       

      Attachments

        Activity

          People

            hjk hjk
            paulmasri Paul
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: