Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
I've made some tiny progress on this in that if I add the directory I created by custom widget in, designer can see it. The other thing I hadn't realised is that to put the widget in a directory other than the one it's in, you seem to need to run "make install" from the command line. However, all this still doesn't really help as I'm getting the error: /home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:59: undefined reference to `rwLineEdit::rwLineEdit(QWidget*)' On this line: testWidget = new rwLineEdit(centralWidget); in the ui_mainwindow.h file. It has autoinserted #include "rwlineedit.h" in the ui_mainwindow.h and I have tried putting in my source directory and in /opt/qtsdk-2010.02/qt/include but to no avail. I have tried taking the example projects directly from the sdk and they refuse to work as well. I have been over and over the documentation now and just can't see what I could be doing wrong. Has no-one else ever tried this? I seem to be close but missing one vital step. :~/ Cheers, Rob > Friedemann Kleint wrote: >> Hi, >> >> here is an extract from the documentation we are planning to add to shed some >> light onto the Qt Designer plugin issue. I hope it helps: >> >> "...You can use Qt APIs to create plugins that extend Qt Designer. Qt >> Designer >> fetches plugins from the standard locations and loads the plugins that match >> its build key. For more information on how to create and locate plugins and >> to >> change the default plugin path, see {How to Create Qt Plugins}. >> >> Qt Designer is integrated into Qt Creator and in addition comes as a >> standalone application. The correct folder to place the plugins depends on >> which you use. The integrated Qt Designer fetches plugins from the >> %SDK%\bin\designer folder on Windows and Linux and >> QtCreator.app/Contents/MacOS/designer folder on Mac. Choose Tools> Form >> Editor> About Qt Designer Plugins. >> >> The standalone Qt Designer is part of the Qt library used for building >> projects, located under %SDK%/qt. Therefore, it fetches plugins from the >> following folder: %SDK%\qt\plugins\designer. To check which plugins where >> loaded successfully and which failed, choose Help> About Plugins in the Qt >> Creator. >> >> The Qt Creator that is included in pre-built SDK packages on Windows is built >> with the Microsoft Visual Studio compiler, whereas the version of Qt shipped >> for building applications is configured and built to use the MinGW/g++ >> compiler. Plugins built by using this version of Qt cannot be loaded by Qt >> Creator because the build-keys do not match. The plugins can only be used in >> the standalone version of Qt Designer. Choose Help> About Qt Creator to >> check >> the Qt version Qt Creator was built with. >> >> If you want to use Qt Designer plugins that were built for the shipped Qt >> version, you need to make sure that Qt Creator is built with the same >> compiler >> by either recompiling Qt Creator using MinGW or recompiling Qt with Microsoft >> Visual Studio, depending on which configuration you want to use for your >> applications." >> >> Regards, >> Friedemann > > > ___ > Qt-creator mailing list > Qt-creator@trolltech.com > http://lists.trolltech.com/mailman/listinfo/qt-creator > ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
On 24/02/10 15:13, Friedemann Kleint wrote: > This probably originates from Qt Designer trying to load a phonon plugin. Try > to remove /opt/qtsdk-2010.02/qt/plugins/designer/libphononwidgets.so and clear > the environment variable QT_PLUGIN_PATH. If it still doesn't work, try to put > /opt/qtsdk-2010.02/qt/bin as the first directory in the PATH. Hi again, Spent quite some time chasing my tail on this in that if I change the path so /opt/qtsdk-2010.02/qt/bin is at the start of my path, it stops the mysql classes working. I have even tried taking the analogue clock widget example and building that with exactly the same result. ie it builds locally, the .so is not put anywhere else and the only way to get designer to see it is by coping the file which gives errors about headers. So, would you be able to confirm: 1. *Should* the .so file be automatically put into a plugins directory? 2. If not, and putting it in manually, why am I getting errors. even if I put an absolute path to the relevant header file? 3. If 1 is true, what can be done to track down why that's not happening? I can just live with creator not opening files is designer as I can open them manually there. It's a pain, but not terrible. IT would be nice to have that working without breaking mysql! It's frustrating because I have a custom widget I really want to be able to drag on to forms in designer! Cheers, Rob ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
Hi Friedemann, >> This probably originates from Qt Designer trying to load a phonon plugin. Try to remove opt/qtsdk-2010.02/qt/plugins/designer/libphononwidgets.so and clear the environment variable QT_PLUGIN_PATH. If it still doesn't work, try to put /opt/qtsdk-2010.02/qt/bin as the first directory in the PATH. << Well, I can now open designer from creator. I did have to put /opt/qtsdk-2010.02/qt/bin as the first directory in the PATH to finally get it going. However, I still have exactly the same problem in that the librwlineeditplugin.so file does not get put in the plugins directory. Again, I can manually copy the file to /opt/qtsdk-2010.02/qt/plugins, but I still get the same sorts of errors: /home/robertw/Software/Qt4/Qt4Test/ui_mainwindow.h:53: undefined reference to `rwLineEdit::rwLineEdit(QWidget*)' I should mention that I do have permissions for the sdk install directory. Just in case it's of interest: printenv QT_INSTALL_PLUGINS /opt/qtsdk-2010.02/qt/plugins I am not really convinced I had the wrong designer last time from the repository anyway, because both designer and creator were 4.6.1. I should maybe mention that I have successfully subclassed things like QPushButton and coded them into programs successfully, it's just getting this integration with Qt Designer that is proving elusive! Yours frustratedly. :~) Rob ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
Hi Rob, > Originally Creator was saying it couldn't find Qt Designer, so I > installed it [designer] from my (Mandriva) repositories and that works > fine other than with the customer widget. So, I wondered whether it was > this issue with different builds. Yes, it means the installed version of Qt Designer is older than the one from the SDK and cannot load the plugins compiled by the SDK. > > With 2010.02 sdk installed, once again, I cannot launch designer from > creator. (By right clicking on the .ui file in the project explorer.) If > I reinstall designer from my repositories I guess I will be able to. > Creator just tells me: > > 'The application "Qt Designer" could not be found'. > If I try and launch designer from the command line I get this error: > > makekdewidgets(12371)/kdecore (KSycoca) KSycocaPrivate::openDatabase: > Trying to open ksycoca from "/var/tmp/kdecache-robertw/ksycoca4" > designer: symbol lookup error: > /usr/lib/kde4/plugins/phonon_backend/phonon_gstreamer.so: undefined > symbol: _ZN6Phonon12PulseSupport11getInstanceEv > > Is there something I am missing here or is designer broken on Linux with > 2010.02? This probably originates from Qt Designer trying to load a phonon plugin. Try to remove /opt/qtsdk-2010.02/qt/plugins/designer/libphononwidgets.so and clear the environment variable QT_PLUGIN_PATH. If it still doesn't work, try to put /opt/qtsdk-2010.02/qt/bin as the first directory in the PATH. Regards, Friedemann -- Friedemann Kleint Nokia, Qt Development Frameworks ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
Hi Friedemann, Many thanks for that. It actually throws up questions! Originally Creator was saying it couldn't find Qt Designer, so I installed it [designer] from my (Mandriva) repositories and that works fine other than with the customer widget. So, I wondered whether it was this issue with different builds. To be on the safe side I downloaded the latest sdk from the website and have installed that, while uninstalling designer from the Mandriva repositories. With 2010.02 sdk installed, once again, I cannot launch designer from creator. (By right clicking on the .ui file in the project explorer.) If I reinstall designer from my repositories I guess I will be able to. Creator just tells me: 'The application "Qt Designer" could not be found'. I have put: /opt/qtsdk-2010.02/qt/bin in my PATH as that seems to be where designer lives. (I didn't previously realise it was in the sdk.) If I try and launch designer from the command line I get this error: makekdewidgets(12371)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-robertw/ksycoca4" designer: symbol lookup error: /usr/lib/kde4/plugins/phonon_backend/phonon_gstreamer.so: undefined symbol: _ZN6Phonon12PulseSupport11getInstanceEv Is there something I am missing here or is designer broken on Linux with 2010.02? Thanks again, Rob Friedemann Kleint wrote: > Hi, > > here is an extract from the documentation we are planning to add to shed some > light onto the Qt Designer plugin issue. I hope it helps: > > "...You can use Qt APIs to create plugins that extend Qt Designer. Qt > Designer > fetches plugins from the standard locations and loads the plugins that match > its build key. For more information on how to create and locate plugins and > to > change the default plugin path, see {How to Create Qt Plugins}. > > Qt Designer is integrated into Qt Creator and in addition comes as a > standalone application. The correct folder to place the plugins depends on > which you use. The integrated Qt Designer fetches plugins from the > %SDK%\bin\designer folder on Windows and Linux and > QtCreator.app/Contents/MacOS/designer folder on Mac. Choose Tools > Form > Editor > About Qt Designer Plugins. > > The standalone Qt Designer is part of the Qt library used for building > projects, located under %SDK%/qt. Therefore, it fetches plugins from the > following folder: %SDK%\qt\plugins\designer. To check which plugins where > loaded successfully and which failed, choose Help > About Plugins in the Qt > Creator. > > The Qt Creator that is included in pre-built SDK packages on Windows is built > with the Microsoft Visual Studio compiler, whereas the version of Qt shipped > for building applications is configured and built to use the MinGW/g++ > compiler. Plugins built by using this version of Qt cannot be loaded by Qt > Creator because the build-keys do not match. The plugins can only be used in > the standalone version of Qt Designer. Choose Help > About Qt Creator to > check > the Qt version Qt Creator was built with. > > If you want to use Qt Designer plugins that were built for the shipped Qt > version, you need to make sure that Qt Creator is built with the same > compiler > by either recompiling Qt Creator using MinGW or recompiling Qt with Microsoft > Visual Studio, depending on which configuration you want to use for your > applications." > > Regards, > Friedemann ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
Hi, here is an extract from the documentation we are planning to add to shed some light onto the Qt Designer plugin issue. I hope it helps: "...You can use Qt APIs to create plugins that extend Qt Designer. Qt Designer fetches plugins from the standard locations and loads the plugins that match its build key. For more information on how to create and locate plugins and to change the default plugin path, see {How to Create Qt Plugins}. Qt Designer is integrated into Qt Creator and in addition comes as a standalone application. The correct folder to place the plugins depends on which you use. The integrated Qt Designer fetches plugins from the %SDK%\bin\designer folder on Windows and Linux and QtCreator.app/Contents/MacOS/designer folder on Mac. Choose Tools > Form Editor > About Qt Designer Plugins. The standalone Qt Designer is part of the Qt library used for building projects, located under %SDK%/qt. Therefore, it fetches plugins from the following folder: %SDK%\qt\plugins\designer. To check which plugins where loaded successfully and which failed, choose Help > About Plugins in the Qt Creator. The Qt Creator that is included in pre-built SDK packages on Windows is built with the Microsoft Visual Studio compiler, whereas the version of Qt shipped for building applications is configured and built to use the MinGW/g++ compiler. Plugins built by using this version of Qt cannot be loaded by Qt Creator because the build-keys do not match. The plugins can only be used in the standalone version of Qt Designer. Choose Help > About Qt Creator to check the Qt version Qt Creator was built with. If you want to use Qt Designer plugins that were built for the shipped Qt version, you need to make sure that Qt Creator is built with the same compiler by either recompiling Qt Creator using MinGW or recompiling Qt with Microsoft Visual Studio, depending on which configuration you want to use for your applications." Regards, Friedemann -- Friedemann Kleint Nokia, Qt Development Frameworks ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
Re: [Qt-creator] Custom widget not showing in Qt Designer on Linux
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@trolltech.com > http://lists.trolltech.com/mailman/listinfo/qt-creator > ___ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator
[Qt-creator] Custom widget not showing in Qt Designer on Linux
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@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator