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

Qt Designer's property editor: the newline character doesn't work with dynamic properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 4.8.5, 5.1.0
    • 4.8.2
    • Tools: Designer
    • None
    • Qt 5: a7d61534acdb90b925d7f250665dcd30c3f37668 Qt 4: 5f0c513f919a8d0a539fca4b5eb50ce125af8514

    Description

      According to Property Editor documentation:

      Qt Designer interprets the backslash () character specially, enabling newline (\n) characters to be inserted into the text; the \ \ character sequence is used to insert a single backslash into the text. A context menu can also be opened while editing, providing another way to insert special characters and newlines into the text.

      But when adding dynamic properties with Qt Designer's property editor, the result in unexpected.

      Steps to reproduce:

      1. Create a new dialog.ui with Qt Desginer
      1. Press the "+" button in Qt Designer's property editor
      2. Select "String.."
      3. Fill the "Property Name" field and select String as the Property Type
      4. Then write e.g. "line1\nline2" into the property's field
      5. create the h file with uic on command prompt: "uic dialog -o dialog.h"
      6. Open the dialog.h -file and check the result:

      Dialog->setProperty("test", QVariant(QApplication::translate("Dialog", "line1\\nline2", 0, QApplication::UnicodeUTF8)));

      So it doesn't recognize the newline character but adds an extra backslash in front of it.

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes