Qt-interest Archive, December 2006
Extend QAction
Message 1 in thread
hi, did anyone here try extending QAction class? I get these error
messages and I dont' know why. Please help!
error LNK2001: unresolved external symbol "public: virtual bool
__thiscall CAction::qt_emit(int,struct QUObject *)"
(?qt_emit@CAction@@UAE_NHPAUQUObject@@@Z)
error LNK2001: unresolved external symbol "public: virtual bool
__thiscall CAction::qt_invoke(int,struct QUObject *)"
(?qt_invoke@CAction@@UAE_NHPAUQUObject@@@Z)
error LNK2001: unresolved external symbol "public: virtual bool
__thiscall CAction::qt_property(int,int,class QVariant *)"
(?qt_property@CAction@@UAE_NHHPAVQVariant@@@Z)
error LNK2001: unresolved external symbol "public: virtual char const *
__thiscall CAction::className(void)const "
(?className@CAction@@UBEPBDXZ)
error LNK2001: unresolved external symbol "public: virtual void *
__thiscall CAction::qt_cast(char const *)"
(?qt_cast@CAction@@UAEPAXPBD@Z)
error LNK2019: unresolved external symbol "public: static class
QMetaObject * __cdecl CAction::staticMetaObject(void)"
(?staticMetaObject@CAction@@SAPAVQMetaObject@@XZ) referenced in function
"public: virtual class QMetaObject * __thiscall
CAction::metaObject(void)const "
(?metaObject@CAction@@UBEPAVQMetaObject@@XZ)
fatal error LNK1120: 6 unresolved externals
thanks
Message 2 in thread
Yep, we do it.
> #include <QAction>
>
> class MyAction : public QAction
> {
> Q_OBJECT
>
> public:
> MyAction(QObject* parent);
> virtual ~MyAction();
> ...
Make sure that Q_OBJECT is included in your class and the header is listed
in the .pri file so that the functions listed below are created in the moc
file.
Keith
On 12-04-2006 7:44 PM, "Thi Nguyen -X (thingu - Aries Technology at Cisco)"
wrote:
> hi, did anyone here try extending QAction class? I get these error messages
> and I dont' know why. Please help!
> error LNK2001: unresolved external symbol "public: virtual bool __thiscall
> CAction::qt_emit(int,struct QUObject *)"
> (?qt_emit@CAction@@UAE_NHPAUQUObject@@@Z)
> error LNK2001: unresolved external symbol "public: virtual bool __thiscall
> CAction::qt_invoke(int,struct QUObject *)"
> (?qt_invoke@CAction@@UAE_NHPAUQUObject@@@Z)
> error LNK2001: unresolved external symbol "public: virtual bool __thiscall
> CAction::qt_property(int,int,class QVariant *)"
> (?qt_property@CAction@@UAE_NHHPAVQVariant@@@Z)
> error LNK2001: unresolved external symbol "public: virtual char const *
> __thiscall CAction::className(void)const " (?className@CAction@@UBEPBDXZ)
> error LNK2001: unresolved external symbol "public: virtual void * __thiscall
> CAction::qt_cast(char const *)" (?qt_cast@CAction@@UAEPAXPBD@Z)
> error LNK2019: unresolved external symbol "public: static class QMetaObject *
> __cdecl CAction::staticMetaObject(void)"
> (?staticMetaObject@CAction@@SAPAVQMetaObject@@XZ) referenced in function
> "public: virtual class QMetaObject * __thiscall CAction::metaObject(void)const
> " (?metaObject@CAction@@UBEPAVQMetaObject@@XZ)
> fatal error LNK1120: 6 unresolved externals
>
> thanks
>