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

REG(5.9): Properties of type "var" display garbage when bound to a call to qsTr

    XMLWordPrintable

Details

    Description

      Hi

       

      After I switched from Qt 5.9.0 to 5.10.0, all my properties declared with type "var" displayed garbage when they were initialized with a call to qsTr. More specifically, it displays a big number (like 98037088). Changing them to use "string" type solved the problem. Not using qsTr also solves the problem.

       

      Minimal example:

      import QtQuick 2.0
      import QtQuick.Window 2.2
      
      Window
      {
          width: 300
          height: 300
          visible: true
      
          property var str1: qsTr("some text")
          property string str2: qsTr("some text")
          property var str3: "some text"
      
          Column
          {
              Text {text: str1}
              Text {text: str2}
              Text {text: str3}
          }
      }
      

       

      #include <QApplication>
      #include <QQmlApplicationEngine>
      
      int main(int argc, char** argv)
      {
          QApplication application(argc, argv);
          QQmlApplicationEngine engine;
          engine.load(QUrl("qrc:/MainWindow.qml"));
          return application.exec();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              laurentgom Laurent
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes