PDA

View Full Version : Adding Custom Widgets to the QT Designer



Polnareff
17th May 2010, 21:58
Hi,

I've only started working with QT just over two weeks ago, but have learned quite a bit in that time. At the moment, I'm trying to create custom widgets which will show up in the QT Designer widget list.

I followed a number of online tutorials, and have only come across problems.

In starting a new "Qt4 Designer Custom Widget" in the QT Creator, it seems that most of the work is already done for me. Originally, I tried this, and added some code to my actual widget, without touching the plugin itself. Despite the fact that the end of my project file specified:

target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target

While everything built fine, the files were not copied to that directory. Even in specifying the actual directory as opposed to using the variable QT_INSTALL_PLUGINS, they weren't copied. I then manually copied the *.a and *.dll files to the directory, and ran QT Designer.

The first time I did this, it actually worked! I soon realized that I'd forgotten to add some things, so I made some changes to the code, re-compiled, copied into the folder, and suddenly, each time I ran QT Designer, I got the "designer.exe has encountered a problem and needs to close" Windows dialog. Even when I reverted to my original working code, this happened, and has continued to since.

I've played a lot with the build configuration, and, as I said, followed some tutorials, making minor changes here and there. But nothing has worked. I'm wondering first about why the files would not be copied to the designer directory...but in general, why I can't get any of it to work! Any help would be greatly appreciated! Thanks.

Polnareff
17th May 2010, 22:31
Okay, so I just decided to do it all myself from scratch following this link:

http://doc.qt.nokia.com/4.6/designer-worldtimeclockplugin.html

And it actually worked! Well, I still had to manually copy the files to the qt/plugins/designer directory. But either way, it did work.

Sorry for the trouble!