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

Component creation recursion check is too conservative

    XMLWordPrintable

Details

    Description

      While making a proof of concept example app I discovered the check for recursion on component creation is too conservative, even shortsighted and therefore limiting in what you can do with QML.

          // Do not create infinite recursion in object creation
          static const int maxCreationDepth = 10;
      

      The app is a QML tree builder, branches can be collapsed and expanded, naturally, this happens recursively. Having depth more than 10 results in the tree not being redrawn properly upon expansion.

      The solution thankfully is rather simple, the default limit can still be left at 10 if that's what is deemed correct, but the user should be able to override that manually when needed, rather than having it hard-coded.

      All it takes is to change maxCreationDepth to not be const, and a static method in the public API to change it if the current use scenario calls for it.

      Attachments

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

        Activity

          People

            rweickelt Richard Weickelt
            utcenter Dian Obreshkov
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes