[Qt-interest] Adding custom widget plugins error/problem

miroslav miroslav at keytos.no
Tue Mar 10 15:07:13 CET 2009


Hi All,

the last mentioned error I have fixed with adding library to *.pro file
No I can run make without error.

Problem is, when I want to execute the program - I'm getting following
error:

"error while loading shared libraries: libworldtimeclockplugin.so:
cannot open shared object file: No such file or directory"


The path to the library is correct because of "make" run without errors.


Where am I making mistake? Custom widget plugin is a shared library?
Should I add a custom widget to a *.pro file? Or?

Hope you can help me..

Thanks,
Miroslav



Please do you know that what can be the problem?


On Tue, 2009-03-10 at 13:12 +0100, miroslav wrote:
> 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
> >  
> 
> 
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest





More information about the Qt-interest-old mailing list