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

Display of string is misleading when changing JavaScript value in Locals and Expressions

    XMLWordPrintable

Details

    • eeb0358d65620f6de39649fbe8b43ee44b5fff8c

    Description

      1. Open this QML code in Creator:
        import QtQuick 2.6
        import QtQuick.Window 2.2
        
        Window {
            visible: true
            width: 640
            height: 480
            title: qsTr("Hello World")
        
            MouseArea {
                anchors.fill: parent
                onClicked: {
                    var someString;
                    someString = "abcd";
                    txt.text = someString
                }
            }
        
            Text {
                id: txt
                text: qsTr("Hello World")
                anchors.centerIn: parent
            }
        }
        

        I have it inside a Qt Quick UI project.

      2. Place a breakpoint in line 15:
        txt.text = someString
      3. Run this in the debugger.
      4. Click the app's window.
        Execution stops at the breakpoint.
      5. In Locals and Expressions view, double-click the value of someString.
        The quotation marks disappear so only the real content of the string is shown.
      6. Type some other characters and press Enter.
        The old value is displayed again.
      7. Repeat step 6 but enclose the string in quotation marks.
        Now the value will be updated.
      8. Continue execution.
        The app uses the value you entered.

      It is confusing that the quotation marks disappear when editing but you then have to add them yourself. Either the quotation marks should not disappear or there should be no need to add them when entering a value.

      Attachments

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

        Activity

          People

            hjk hjk
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes