[Interest] error when trying to emit custom object via QObject.Signal

Jérôme Godbout godboutj at amotus.ca
Mon Aug 27 15:06:58 CEST 2018


You will probably need to have the object declared to the meta type (sorry
I don't known the call, but there must be one into PySide 2, you might want
to dig into the doc near this
https://doc.qt.io/qtforpython/PySide2/QtCore/QMetaObject.html ) and ideally
be copiable since you will send the signal from another thread (from your
QRunnable). So the signal will probably be queued adn therefore will need
to copy the arguments to the signals.

On Mon, 27 Aug 2018 at 05:14, Frank Rueter | OHUfx <frank at ohufx.com> wrote:

> Hi all,
>
> I am trying to emit a custom object via QObject.Signal from inside a
> QRunnable.
> The object I am trying to emit throws this error:
>
> TypeError: Value types used on meta functions (including signals) need to
> be registered on meta type: *NameSpace::**NameSpace*::Clip
>
> I tried to trick it by creating a wrapper class like so
>
> class NodeItem(QtCore.QObject):
>     def __init__(self, node, clip):
>         QtCore.QObject.__init__(self)
>         self.node = node
>         self.clip = clip
>
> But that crashes the app when I try to emit it from a QRunnable, even
> though it works i the main thread.
>
> I have tried to find information on how to register meta types but cn only
> find C++ info about Q_DECLARE_METATYPE.
> This does not seem to exist in Python land though?!
>
> Does anybody have any ideas? I’m kinda stuck with this one.
>
> Cheers,
> frank
>> --
>
> [image: ohufxLogo 50x50] <http://www.ohufx.com>
> *vfx compositing <http://ohufx.com/compositing.html> | workflow
> customisation and consulting <http://ohufx.com/customising.html> *
>     * <http://ohufx.com/compositing.html>*
> <http://www.nukepedia.com/nubridge>
>
> Your gateway to over 1,000 free tools... right inside of Nuke
> <http://www.nukepedia.com/nubridge>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180827/acbbdb00/attachment.html>


More information about the Interest mailing list