Skip to content

Thread Dispatcher / SynchronizationContext for Qt Thread #2

Closed

Description

@Theneillsaaco

Description

Title: Feature Request: Support running code on the Qt thread from background tasks (Dispatcher / SynchronizationContext)

Is your feature request related to a problem? Please describe.
Setting properties from a background thread-pool task isn't safe, and currently, there is no built-in dispatcher or synchronization context to jump back to the Qt/UI thread.

As a workaround in view models, I have to use a concurrent queue and a polling timer in QML:

private readonly ConcurrentQueue<Action> _ui = new();
task.ContinueWith(t => _ui.Enqueue(() => done(t.Result)));
public void Poll() { while (_ui.TryDequeue(out var a)) a(); }

And in QML: Timer { interval: 250; onTriggered: vm.poll() }. This works, but introduces extra latency and polling overhead.

Steps to reproduce

.

Expected behavior

Describe the solution you'd like
A Qt.Dispatcher.Post(Action) or a SynchronizationContext bound to the Qt thread, allowing await continuations to update view model properties safely and directly.

Actual behavior

.

Qt Bridge for C# version

TP (C#)

Qt version

6.12

.NET SDK version

10

Operating system and architecture

Linux/nixos

Tooling

Other

Logs

Activity

  1. added
    jiraTriaged; adding this label moves the issue to the Qt bug tracker and closes it
    on Nov 12, 2026
  2. deleted a comment from github-actions on Nov 12, 2026
  3. added
    jiraTriaged; adding this label moves the issue to the Qt bug tracker and closes it
    and removed
    jiraTriaged; adding this label moves the issue to the Qt bug tracker and closes it
    on Nov 12, 2026
  4. deleted a comment from github-actions on Nov 12, 2026
  5. added
    jiraTriaged; adding this label moves the issue to the Qt bug tracker and closes it
    and removed
    jiraTriaged; adding this label moves the issue to the Qt bug tracker and closes it
    on Nov 12, 2026
  6. github-actions commented on Nov 12, 2026

    @github-actions

    Thank you for the report. It is now tracked as QTBRIDGES-465 in the Qt bug tracker. Please follow up there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjiraTriaged; adding this label moves the issue to the Qt bug tracker and closes it

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions