Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106651 Create a simple UI effect type for Qt Quick
  3. QTBUG-109555

MultiEffect affecting source item size when layer.enabled

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Fixed
    • P2: Important
    • 6.5
    • Quick: Other
    • None
    • 8ce94e0dc (dev), 63998df89 (6.5)

    Description

      This is either a bug or a feature. See the attached example app.

      Steps:

      • Use some Item with "layer.enabled" as a source for MultiEffect.
      • Don't hide that item (visible: false).
      • Enable MultiEffect blur and/or shadow.
      • Keep autoPaddingEnabled or set paddingRect to extend the item size.
        --> The item used as source is also changed.

      This happens as SourceProxy reuses the input item and just sets sourceRect of it directly. Usually this isn't an issue as source item has "visible: false" and MultiEffect item is shown instead.

      Comparing to Graphical Effects: GaussianBlur with transparentBorder:true is also affected with this. But FastBlur is not, as it doesn't set sourceRect of QGfxSourceProxy but instead has extra ShaderEffectSource (level1) with the sourceRect. We could do the same with MultiEffect, but would want to avoid extra ShaderEffectSource.

      Possible solutions:

      1) Leave this behavior and document it into "source" property. Something like: "Note: If source item has layer.enabled set, the source item will be used directly. If the effect adds padding, that padding will be set to the source item which can affect the appearance of the source item."

      2) Modify QGfxSourceProxy to use extra QQuickShaderEffectSource whenever sourceRect is not empty. Cons of this is that when source item could be used (e.g. it is visible: false) extra QQuickShaderEffectSource gets created.

      3) Add API to control ProxySource behavior, some way to force it instead of current auto method. When forced, hasProxySource would always return true? So should this be actually renamed to "useProxySource" and have WRITE method, when not set it would use auto detect?

      Attachments

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

        Activity

          People

            kagro Kaj Grönholm
            kagro Kaj Grönholm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes