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

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Tue Mar 10 23:46:30 CET 2009


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?
> 
> Thanks,

Hi Miroslav, 

It looks like the generated ui_*.h file does not have the correct include
for the header of the widget. 

In the plugin code, you need to return the correct name for the header file
of the widget - not the header file of the plugin. 

The path to the widget header file also needs to be in the .pro file. 

Note that the header file name is stored in the .ui file. So if you change
the values returned by the plugin, you will need to resave the form in the
designer (or edit the ui file manually). 

Hope that helps, 

Tony.




More information about the Qt-interest-old mailing list