[Qt-creator] Custom widget not showing in Qt Designer on Linux

Robert Wood robert.wood at apostrophe.co.uk
Wed Feb 24 10:02:09 CET 2010


OK, so I have found my $$[QT_INSTALL_PLUGINS]/designer directory and, 
indeed, the .so file is not getting put there. I can copy it from the 
source directory and then Qt designer does see the widget in the "Rob's 
stuff" location.

It can't find the header file, so I just tried putting that in with the 
rest of the program project's source and I then get the following errors:

/home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:35: error: 
declaration of ‘rwLineEdit* Ui_MainWindow::rwLineEdit’

/home/robertw/Software/Qt4/Qt4Test/rwlineedit.h:7: error: changes 
meaning of ‘rwLineEdit’ from ‘class rwLineEdit’

/home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:53: error: expected 
type-specifier before ‘rwLineEdit’

/home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:53: error: cannot 
convert ‘int*’ to ‘rwLineEdit*’ in assignment

/home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:53: error: expected 
‘;’ before ‘rwLineEdit’

Does that help in suggesting where the issue might be? Why would the .so 
file not be copied to the plugins directory? The widget itself seems to 
be compiling correctly!

Thanks again,

Rob

Robert Wood wrote:
> I'm trying to get a very simple custom widget to show in Qt designer, 
> but just can't get it to work, wondering whether anyone can help.
> 
> In Qt Creator, I did File | New  and chose Qt4 Designer Customer Widget. 
> I gave it a name rwLineEdit  then in the next box typed in rwLineEdit as 
> the name of my Widget Classes.  (Not really clear why this has to be 
> done twice.)
> 
> This then gives me all names of all the files such as rwlineedit.pri, .h 
> etc and the plugin names the same but with plugin inserted. I chose my 
> Widget Base Class as QLineEdit, fileld into some descriptions, 
> includingstating a (non existent group - I'm assuming At designer 
> handles that and makes a new one?).
> 
> Next window only allows me to edit PlginName which I leave as 
> rwlineeditplugin and the resource file as icons.qrc (again I left this). 
> It adds a load of files and all seems well. I can add a routine to the 
> class and compile it.
> 
> The problem is, that when I launch Qt Designer it simply refuses to show 
> up!
> 
>  From what I can see of the tutorials on how to do custom widgets the 
> information seems to be in the source files. For example:
> 
> Q_EXPORT_PLUGIN2(rwlineeditplugin, rwLineEditPlugin)
> 
> Is at the bottom of rwlineeditplugin.cpp
> 
> I have put all this in ~/Software/Qt4/customWidgets/rwLineEdit/ and I 
> end up with a librwlineeditplugin.so file in there, but am thinking that 
> should be somewhere Qt Designer looks at, which I thought was specified in:
> 
> target.path = $$[QT_INSTALL_PLUGINS]/designer
> 
> Would be really grateful if someone can point me in the right direction 
> on this.
> 
> Many thanks,
> 
> Rob
> 
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
> 



More information about the Qt-creator-old mailing list