Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt backend: animation of window properties doesn't work #7286

Open
task-jp opened this issue Jan 6, 2025 · 2 comments
Open

Qt backend: animation of window properties doesn't work #7286

task-jp opened this issue Jan 6, 2025 · 2 comments
Labels
a:backend-qt The Qt backend - including the qt style (mO,bS) bug Something isn't working

Comments

@task-jp
Copy link
Contributor

task-jp commented Jan 6, 2025

Bug Description

I'm attempting to animate the background color of a Window with animation-tick(), but it doesn't work as expected when using the Qt backend:

Expected Behavior
The background color should continuously animate without requiring user interaction, even when using the Qt backend.
Actual Behavior
The background color only updates on user interaction (window, mouse, or keyboard events) when using the Qt backend.

When I set SLINT_NO_QT=1 or use slintpad, it behaves correctly and continuously animates the background color.

Reproducible Code (if applicable)

export component App inherits Window {
    background: red.mix(blue, (sin(animation-tick() / 1s * 360deg) + 1) / 2);
}

Environment Details

  • Slint Version: 1.8.0, 1.9.1
  • Platform/OS: Kubuntu 24.04/X11
  • Programming Language:
  • Backend/Renderer: Qt

Product Impact

No response

@task-jp task-jp added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Jan 6, 2025
@ogoffart
Copy link
Member

ogoffart commented Jan 6, 2025

The Qt backend queries the background in
update_window_properties(&self, properties: WindowProperties<'_>>

But for some reason, this doesn't seem to be called when the properties are dirty.
Another way to reproduce:

export component Example inherits Window {
        title: "Hi " + (animation-tick()/1s);
}

The title change with the winit backend but not with the Qt backend

@ogoffart ogoffart added a:backend-qt The Qt backend - including the qt style (mO,bS) and removed need triaging Issue that the owner of the area still need to triage labels Jan 6, 2025
@ogoffart
Copy link
Member

ogoffart commented Jan 6, 2025

The problem is that the animation-tick() property doesn't change until update_timers_and_animations is called. And this is not call unless something else happens for Qt.

@ogoffart ogoffart changed the title Window: background color animation fails to update continuously with Qt backend Qt backend: animation of window properties doesn't work Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:backend-qt The Qt backend - including the qt style (mO,bS) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants