Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-362

String Objects arg() method not working properly inside a QML function

    XMLWordPrintable

Details

    Description

      Within a QML function, I want to use its argument as the argument of a string objects arg() function. But this does not work as expected. It only works, if I store the parameters value into a local variable first and then use this local variable as the argument for the arg() function. To illustrate that, I created a simple example project:


      As you can see, without the intermediate step of storing the functions argument into a local variable, the arg() function will not replace the "%1" with the given argument.

       

      Expected/Desired Behaviour:
      When using the QML functions argument directly for the arg() function, the "%1" in the text will be replaced by the given argument.

      Attachments

        1. QtForMCU_bug.PNG
          57 kB
          Jan Brupbacher
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jan.brupbacher Jan Brupbacher
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes