Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, August 2006
[]QT4] custom QEvent::User+100 error


Message 1 in thread

Hi,
I am porting my code Qt3 to Qt4.Becasue QCustomEvent wasn't exsit in Qt4,
I want use QEvent replace QCustomEvebt.

But I can't use  "QEvent::User +100"  as a parameter pass to the QEvent.

error msg following

***********
**
error C2664: 'QEvent::QEvent(QEvent::Type)' : cannot convert parameter
1 from 'int' to 'QEvent::Type'
***
***********

Anyone know how to add a  QEvent::User   between 1000 and
QEvent::MaxUser  in QEvent ?



my code following:


class ProdEvent : public QEvent
{

	//QEvent::User==1000
public:
    ProdEvent(long s, bool d)
	: QEvent(QEvent::User +100 ), sz(s), dn(d)
    { ; }
 long size() const { return sz; }
    bool done() const { return dn; }

private:
    long sz;
    bool dn;

}


Best Regards.
wya.
2006 08 21

--
 [ signature omitted ] 

Message 2 in thread

wya yang [mailto:htyoung.cn@xxxxxxxxx] 
> Anyone know how to add a  QEvent::User   between 1000 and
> QEvent::MaxUser  in QEvent ?
> 
> 
> 
> my code following:
> 
> 
> class ProdEvent : public QEvent
> {
> 
> 	//QEvent::User==1000
> public:
>     ProdEvent(long s, bool d)
> 	: QEvent(QEvent::User +100 ), sz(s), dn(d)

Have you tried

	: QEvent(QEventType(QEvent::User +100)), sz(s), dn(d)

Andre'

--
 [ signature omitted ] 

Message 3 in thread

Thnaks , it's ok,
use following:

:QEvent(ype(QEvent::User +100)), sz(s), dn(d)

On 21/08/06, André Pönitz <andre@xxxxxxx> wrote:
> wya yang [mailto:htyoung.cn@xxxxxxxxx]
> > Anyone know how to add a  QEvent::User   between 1000 and
> > QEvent::MaxUser  in QEvent ?
> >
> >
> >
> > my code following:
> >
> >
> > class ProdEvent : public QEvent
> > {
> >
> >       //QEvent::User==1000
> > public:
> >     ProdEvent(long s, bool d)
> >       : QEvent(QEvent::User +100 ), sz(s), dn(d)
>
> Have you tried
>
>        : QEvent(QEventType(QEvent::User +100)), sz(s), dn(d)
>
> Andre'
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ]