[Interest] How to start object in the thread?

Thiago Macieira thiago.macieira at intel.com
Mon Jun 9 00:24:26 CEST 2014


Em seg 09 jun 2014, às 00:10:33, igor.mironchik at gmail.com escreveu:
> Thanks guys for your replies.
> 
> I've found the problem. The problem was in Object's event() method...
> 
> But now I have another problem.
> 
> In my test app I have custom event that I post with
> QCoreApplication::postEvent().
> 
> All seems ok, events posted and received but with another type that I
> expect.
> 
> static const int changeColorEventType = QEvent::registerEventType();
> 
> class ChangeColorEvent
> 
>     :    public QEvent
> 
> {
> public:
>     ChangeColorEvent()
> 
>       :    QEvent( static_cast< QEvent::Type >( changeColorEventType ) )
> 
>    {
>    }
> };
> 
> Is this code right?

Yes.

> In my Object's event() I receive events with type 65533 when
> changeColorEventType is 65535...

That's another event, not yours. Don't handle it, just pass to QObject's 
handler.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list