[Interest] How to start object in the thread?

igor.mironchik at gmail.com igor.mironchik at gmail.com
Mon Jun 9 07:59:45 CEST 2014


Sorry... It's not a bug... It's my mistake...

-----Original Message----- 
From: igor.mironchik at gmail.com
Sent: Monday, June 09, 2014 1:37 AM
To: Thiago Macieira ; interest at qt-project.org
Subject: Re: [Interest] How to start object in the thread?

Actually Thiago it's my event. It's looks like a bug.

When I changed

static const int changeColorEventType = QEvent::registerEventType();

to

static const int changeColorEventType = 2000;

all works fine.

P.S. In my test app I have only one custom event...

-----Original Message----- 
From: Thiago Macieira
Sent: Monday, June 09, 2014 12:24 AM
To: interest at qt-project.org
Subject: Re: [Interest] How to start object in the thread?

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

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list