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

Quick Designer crashes when adding Text item with a quote

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • Qt Creator 4.6.2
    • Quick Designer
    • None

    Description

      Steps to reproduce:

      1. Create a new QtQuick UI File
      2. Drag in one Text element from the Qt Quick Basic collection
      3. Write something including a single, non-escaped quote, e.g: holler"

      Console output:

      *** Possible problem: QML file wasn't parsed correctly.
      *** QML text: "import QtQuick 2.4\n\nItem {\n width: 400\n height: 400\n\n Text {\n id: text1\n x: 161\n y: 141\n text: qsTr(\"holler\"\")\n font.pixelSize: 12\n }\n}\n"
      *** "Expected token \")\"."
      RewriterException: Error rewriting document
      Content: import QtQuick 2.4
      
      Item {
      width: 400
      height: 400
      
      Text {
      id: text1
      x: 161
      y: 141
      text: qsTr("holler"")
      font.pixelSize: 12
      }
      }
      
      Exception: "RewritingException"
      Function: "applyChanges"
      File: "/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/rewriterview.cpp"
      Line: 427
      

      As you can see, the quote is not escaped correctly, which leads to a crash.

      Attachments

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

        Activity

          People

            thohartm Thomas Hartmann
            terjerunde Terje Runde
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes