Custom Widget Plugin "cannot instantiate abstract class" porting from Qt3 to Qt4
Hi!
I am porting custom widget plugins for Qt Designer from Qt3 to Qt4.
I managed to solve all errors except one.
I have a PURE VIRTUAL function which is not implemented:
Code:
virtual void paintRow( Q3Painter *p, const QColorGroup &cg, int row, CRow *pRow ) = 0;
In my plugin class:
Code:
{
return new CLargeList(parent);
}
It says:
Quote:
>.\largelistplugin.cpp(61) : error C2259: 'CLargeList' : cannot instantiate abstract class
> due to following members:
> 'void CLargeList:: paintRow(Q3Painter *,const QColorGroup &,int,CRow *)' : is abstract
>d:\projcomp\qt\largelist\largelist.h(122) : see declaration of 'CLargeList:: paintRow'
I have tried this and it works:
Code:
virtual void paintRow( Q3Painter * /*p*/, const QColorGroup & /*cg*/, int /*row*/, CRow * /*pRow*/ ) { ; }
but when i want to use my plugin in a test application i get an unresolved external simbol error.
How can i create a working plugin?
I am looking forward for your help.
Thank you.
Re: Custom Widget Plugin "cannot instantiate abstract class" porting from Qt3 to Qt4
Designer plugins in Qt4 need quite some changes when ported.
Show the full code, what you posted is not enough inorder to see the problem.
Re: Custom Widget Plugin "cannot instantiate abstract class" porting from Qt3 to Qt4
Hi!
I found out that the linker error was not caused by the default virtual function.
So the default function is solving the problem with pure virtual function.
Thank you.