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

Reformatting QML issue

    XMLWordPrintable

Details

    • macOS

    Description

      I have a .qml file that has several for loops.

      IE:
       
      for (var i = 0; i < days.length; i++) {

        if (currentDay === days[i]) {

          logger.info(mediaMsg(media, "matched day " + currentDay));

          return true;

          }

      }

       

      When I select Tools->QML/JS->Reformat File it does this:
      notice that the var i = 0 is missing in the for statement and the semi colon is missing at the end of the logger.info line and return true line
       
      for (; i < days.length; i++) {

        if (currentDay === days[i]) {

          logger.info(mediaMsg(media, "matched day " + currentDay))

          return true

          }

      }

       

      Is there something I am missing ?

      If I reformat then it gives error of undefined variable i.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            bikeaccdnt James Thornton
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes