[Interest] Calling QT Class method from pthread thread

Konstantin Shegunov kshegunov at gmail.com
Wed Oct 4 18:07:38 CEST 2017


On Wed, Oct 4, 2017 at 6:50 PM, Gonzalo Aguilar Delgado <
gaguilar at aguilardelgado.com> wrote:

> Hi Konstantin,
>
> That's something I was not aware of.
>
You're explicitly casting an opaque to an object pointer, and there can be
literally anything behind that address, the compiler has no way of knowing
what exactly.

> Do you think that registering the address using this pointer here is
> wrong?
>
I have no way of answering this. I don't know what library you're using and
how you're supposed to pass context along with the object if at all. You
should consult the library's documentation. It may wrap the pointer you
pass it in an object of its own, and give you that in the call back, I
can't tell.


> Or it's just that there's a bug on the library that's passing me that
> value?
>
Possible, although I'd bet against it. Check the docs and see what the
callback parameter is supposed to be, then act on it accordingly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171004/6cb0173e/attachment.html>


More information about the Interest mailing list