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

update() in StaticText struct gets called twice unnecessarily

    XMLWordPrintable

Details

    • All

    Description

      My guess is this is an issue in qml2cpp.

      I happened to find this while doing a research on how StaticText works.

      I attached the little project I'm working on for you to check the behavior on your side.

      In the generated "outcome/05_04+use_StaticText/gen/TranslationMetaDataManyTexts_Experiment.cpp," there are lines like this:

      Here, it's basically setting the StaticTextItem instances to each of StaticText instances, using StaticText::setStaticTextItem() method.
      After that, there's a line below calling StaticText::update() for each StaticText::setStaticTextItem().

       

      The issue is, StaticText::setStaticTextItem() method calls StaticText::update() everytime it's called.

      <statictext.cpp>

       
      So the StaticText::update() gets called twice. I think we can omit the one in the auto-generated code by qml2cpp.
       

      Attachments

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

        Activity

          People

            srodal Samuel Rødal
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes