fix warning "TypeError: Value is null and could not be converted to an object
(exception occurred during delayed function evaluation)"
When using a lambda with `callLater`, QML doesn't check with that used objects
exists, this can be problematic during the destruction phase. Using an object
function fix the issue (observed with Qt 6.2 and 6.8)
This is done to make the csd shadow look more natural,
as with the current margin the blur/glow radius has to
be quite limited for the shadows to fit in the window.
Currently window managers/compositors even use layered
shadows (stacking of multiple shadows), so having one
shadow that is concentrated looks odd in 2025. After
this, we should also consider if we want to follow a
similar approach. We currently have `DoubleShadow`,
perhaps that would be nice to use it, at least as the
first step.
I have done this only on Wayland (not X11) because there
we use input mask to let the events pass through beyond
the csd resize area (`MainCtx.csdBorderSize`). This means
that we are practically free with regard to the margins,
if we want it can be bigger.
Whereas on X11 we have to use a reasonable window margin,
because the window would receive the input events also
in this region. Even though we don't really consume the
input events in this region in the application, these
events are not passed to what is available behind. I
don't know if this is just how X11 behaves, or it is a
Qt bug that Qt windows consume input events whether or
not the application itself used/consumed them.
passing binding to object to createObject fails with Qt6.4, see QTBUG-125095.
Using `var` properties as suggested in the Qt bug report isn't enough to
workaround the issue.
The proposed approach is to create a local QtObject containing the bindings and
pass it in the delegate creation (without binding), then we create readonly
properties to the model properties for convenience
fix: #29430
There has been nothing that used this node since we started
to use SDF to draw rounded images (40dcb6a4).
Using this node would be beneficial where having a custom
geometry with triangle strips is more favorable than
having an expensive fragment shader. At the same time, if
MSAA is enabled, there would be anti-aliasing while keeping
the primitive opaque (which is important for effective
batching), where with the SDF approach this is not possible.
Currently we do not offer a way to enable MSAA, and without
MSAA, it lacked AA completely. Implementing AA with SDFs
is much easier than implementing "vertex" AA with custom
geometry.
Requesting MSAA by default is still on the table though,
because that way built-in Qt items would also not need to
use "vertex" AA, and as Qt docs noted, this would improve
batching overall. This is mostly relevant for round items,
such as `Rectangle` with `radius`.
For some reason Qt calls `::updatePaintNode()` when the item is invisible
initially.
This is reproduced at initialization, such that pip player is invisible when
it is created but due to that video window adjusts itself to the invisible
pip player for no reason.
Current index of the view and the current index of the
playlist are not a one-to-one match.
The view, when applicable, may track the playlist
current index. However, when the view current index
changes, such as due to keyboard navigation, it is
fair that the view current index deviates from the
playlist current index. It is also fair to not
change the current index of the view at all, but
rather make the new playlist current item visible,
which is what is the case with this patch.
This fixes the situation of the view scrolling
unwantedly when, for example, playlist current index
changes due to adding or removing items preceding to
the playlist current item while the current item
remains the same.
This is an optimization case for opaque background color.
With custom blending, we could potentially achieve the same
even if the background is not opaque, but that requires more
investigation since in such a case, not only the view elements
would be affected but the whole primitives drawn before in the
same area, while the fading edge effect should only be applied
to the primitives of the view (and not the background).
If the effect is not live, we can update the source texture sizes of the
layers once. There is no need to constantly update the texture sizes in
non-live case, because the textures do not change.
The important animation here is the size animation, opacity
animation is something that is not really important.
We do not want to animate the opacity at initialization. In
other cases, we often enable the behavior when the component
completes, so that at initialization opacity change is not
animated. Since the animation is not important, we can just
get rid of it instead.
The binding was made delayed to fix a binding loop, which was
not symptomatic. This delay causes the scroll bar to appear
intermittently.
I no longer get the warning without the delay, so it seems
safe to get rid of the delay. Besides, there seems no apparent
reason to have a binding loop here, footer's (y) position
should not depend on footer's height to cause a binding loop.
It is generally advised to avoid branching in fragment shader,
but in this case the condition is a uniform value, so it is
not terrible to do this. This way, we avoid the unnecessary
crop calculations.
An alternative to this would be generating new shaders with
preprocessor defines to avoid branching. Considering we already
have a branch for `borderRange`, we might as well have branches
for crop rates.
Otherwise bounds are not correctly calculated for certain cases, such as
having a header with overlay positioning. Currently this bug does not
seem to be exposed, though.
If `textureProviderItem` is overridden but set to null,
the `ShaderEffect` is going to use the default `Image`
as the texture provider. In that case, `Image` should
load the image.