#include <QEvent>#define LOG_VIEW_TEXTEDIT_CLEAR 1001class CLogViewEvent : public QEvent{ public: CLogViewEvent( Type type):QEvent(type){};};void main(){ CLogViewEvent tut(QEvent::ActionRemoved ); // good CLogViewEvent hh(LOG_VIEW_TEXTEDIT_CLEAR); //error cannot convert parameter 1 from int to //QEvent::Type }
CLogViewEvent hh((QEvent::Type)LOG_VIEW_TEXTEDIT_CLEAR);
#define LOG_VIEW_TEXTEDIT_CLEAR ((QEvent::Type)(QEvent::User+1))class CLogViewEvent : public QEvent{ public: CLogViewEvent():QEvent(LOG_VIEW_TEXTEDIT_CLEAR){};};