[Qt-interest] Adding custom widget plugins error/problem
miroslav
miroslav at keytos.no
Tue Mar 10 13:12:44 CET 2009
Hi,
the custom widget constructor is specified here:
WorldTimeClockPlugin::WorldTimeClockPlugin(QObject *parent)
: QObject(parent)
{
initialized = false;
}
Please, where should I initialize the constructor? I'm designing
(importing custom widgets) via designer in QtCreator. That is making
ui_*.h file - that I can not modify.
thnks,
Miro
On Tue, 2009-03-10 at 11:14 +0100, Andreas Pakulat wrote:
> On 10.03.09 11:05:02, miroslav wrote:
> > Hi,
> >
> > thanks for the reply,...but....please can you give me more hints?
> > Constructor where/what? In the main window where I want to have the
> > CustomWidgetPlugin?
>
> Your custom widget has a constructor and that one needs to have QWidget*
> parameter as first, passing it on to its parent class. Looking again at
> your error message, you might even have that constructor declared, but
> didn't implement it.
>
> Andreas
>
On Tue, 2009-03-10 at 10:27 +0100, Andreas Pakulat wrote:
> On 10.03.09 09:52:59, miroslav wrote:
> > Hi All,
> > please can you help me with this?
> >
> > I have compiled the worldtimeclockplugin and placed it into
> > QtCreator/Designer folder.
> >
> > When I move it to my form and compile it I'm getting following
error:
> >
> > /media/disk/01_SourceCodes/05_VFST/src/ui_VFST.h:80: undefined
reference
> > to `WorldTimeClock::WorldTimeClock(QWidget*)'
> > :-1: error: collect2: ld returned 1 exit status
> >
> >
> > On line 80: was generated following code:
> > worldTimeClock = new WorldTimeClock(centralWidget);
> >
> >
> > Please do you know that what can be the problem?
>
> You didn't specify a constructor for your custom widget usable for the
> generated code. You have to supply a constructor taking a QWidget*
> argument, just like QWidget and QWidget derived classes in the Qt API
do.
>
> Andreas
>
More information about the Qt-interest-old
mailing list