On Wednesday, 7 June 2023 01:53:47 PDT JiDe Zhang wrote:
> I am writing a tool to allowed call a function in the specified existing
> thread, I want to contribution it to Qt project, are you like?

We do this internally, but don't usually expose it. If you're going to 
contribute it, please make sure your contribution uses QMetaCallEvent.

Anyway, the important question is whether you have the QThread for that thread 
or an object that lives in that thread. If you have the latter, it's already 
easy to do so:

  QMetaObject::invokeMethod(obj, Qt::QueuedConnection, [] { doSomething(); });

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to