[Qt-interest] Problem with designer plugins

Robert Wood robert.wood at apostrophe.co.uk
Sat Mar 6 00:27:04 CET 2010


>> I did do this and re-started. No joy. But just realised that there may 
be a difference between QtCreator and Designer and it seems to be so. 
Designer does load the plugin. The manual does not make this clear. In 
fact I am sure that the example is labelled for Custom Plugin for QtCreator. <<

As the plugin is for designer, this was the one vit that seemed obvious to me. ;~) 

>> It so seems that the lib file needs to be manually copied. The example 
states that the last INSTALLS line in the .pro file should do the 
copying. Is this a Qt bug? <<

I *think*, and you have to bear in mind that I am a bit of a newbie to programming on a PC, that you have to do make install, just as you would when installing a program. I did try this and it didn't install properly, I can't remember why. It might have been copying it to the wrong place or just not doing it at all. 

In the end I wrote a very simple bash script to copy the .so files to where designer could see them and where my application could see it. I guess that if your makefile is correct, when you do make install the shared library gets copied to the relevant place for your distribution. Now I have it working I should revisit it and get it working properly I suppose. 

>> Don't forget also, that you'll have to add the new lib name path to your 
> .pro file and have the header file available for your program to compile!
>   
Is this step really necessary? I thought these were plugins that could 
be loaded into your application dynamically. I understand about the  
header file. <<

Try it without and see if you get an undefined reference. :~) I did something like LIB +=/path/libwidgetnameplugin, again I can't quite remember the exact syntax and I'm not on the right PC. If you're struggling I'll check tomorrow. It does make sense though as you have to make your application
aware of it as well as designer, which is the point that I completely failed to grasp until André kindly pointed it out.  

I am not at all convinced I'm doing it the most elegant way, but it does at least work now. Baby steps and all that! 

Cheers,

Rob








More information about the Qt-interest-old mailing list