PDA

View Full Version : custom widget plugin example - HOWTO on Windows with QtCreator



matz
25th November 2010, 20:40
hi,

I have tried a lot and thought a lot before posting this thread, but I'm still having troubles creating a custom widget plugin for QtCreator/Designer and I would be very thankful if you could help me out here. I had a look in the forum and also searched around the web, without finding really helpful information.

I'm using Windows7 and QtCreator 2.0.1.

I had a long look at the examples found at : http://doc.qt.nokia.com/4.6/designer-creating-custom-widgets.html and http://doc.qt.nokia.com/4.6/designer-customwidgetplugin.html, still they leave the question to me, how to move on from there.
I also tried out the custom widget assistant which comes along with QtCreator, but without success.

Sorry, if this question sounds stupid to you (I'm quite new in the Qt business), but how do I compile the custom widget code?

I mean, do I just compile it with QtCreator? or from the command prompt with qmake and make? (My QtCreator which comes with the Nokia Qt SDK only has a command prompt for Symbian, I don't know if there's supposed to be another one...).
I know that QtCreator basically only executes qmake and make as well (with a lot of parrameters.


Maybe somebody could give me a simple, yet comprehensive, step by step instruction how to create, compile and use a custom widget plugin. Like do you use QtCreator at all when you create the custom widget plugin and so on. I would really appreciate that.
Unfortunately the official documentation is somewhat confusing, or not complete enough, imo.



Thanks a lot.

pan
26th November 2010, 08:22
I assume you have created the code.

You will need to compile it in the same version as the designer you are using.
You will also need to place the dll in qt creater's bin/designer directory.

Once it is in the correct directory open the designer and a form ui. Then: Tools -> Form Editor -> About Qt Designer plugins...
In the popup window you will see if it loaded or if there was an error. And the error should explain what you need to do.

I think for windows designer you get as the standard, you need to compile it with msvc compiler in release... But check the error to make sure.