This is my tutorial for every people who wants to use their own custom widgets or need to compile QtCreator under mingw.
To be in mind :
This little tutorial covers : (CWPlugins = Custom Widget Plugins)The QTCreator downloaded from nokia is MSVC based.
The QT Framework and QT Designer are mingw based.
This is one of the reasons because your plugings can be seen at QT Designer but not at QT Creator. The other is a simply variable setting at .pro file of your plugin .
1.- I can not build CWPlugins
2.- I don’t see nor can to use some CWPlugins, specially those created by me.
3.- I cannot build QtCreator or I dont know how to compile QtCreator with mingw
1.- I can not build CWPlugins
Solution: the .pro file must have this basic content
CONFIG += designer plugin debug_and_release <<< The most important
TARGET = $$qtLibraryTarget(the_dll_future_name)
TEMPLATE = lib
LIBS += -L.
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
Basically this content is automatically maked by the QTCreator assistant. But at previous versions and at forum you could find wrong instructions and your plugin did not be created or identified.
2.- I don’t see nor can to use some CWPlugins, specially those created by me.
Solution : please see at
QT Creator > Tools > Form Editor > About QTDesignerplugins
or
QTDEsigner > Help > About Plugins
In the window showed, you can view the plugins uploaded and those who could not be loaded, and the reason they have not been charged.
The reasons are mainly two :
a-A difference betwen release and debug build key expected and the key found.
(Solved at point 1)
b-A difference betwen the compiler at build key expected and key found. So to solve this we need to use a QtCreator built with mingw.
3.- I cannot build QtCreator or I dont know how to compile QtCreator with mingw
As I mentioned at the beggining, QTcreator is MSVC based and your plugins are mingw based. So we need a QtCreator compiled with mingw.
It is amazing that NOKIA says at its web page the next ‘
Qt SDK for Windows* (322 MB)
Based on MinGW (download sources) tool set. Does not support VS compiler.
So, why is the reason because you offer a QTCreator MSVC based ????
Mmmm, anyway we need a QTcreator built with mingw. The steps you must to follow are:
1.- Download QT Creator source from QT
2.- Be sure you have the same version for QT framework, if not download the correct QT SDK.
3.- Unzip the qtCreator to QtcreatorSource (for example)
4.- Make a new folder named MyQtCreator
5.- Copy the content of QtcreatorSource to MyQtCreator
(this is a littel trick, QTCreatorSource has always a clean data if you need it)
6.- be sure that your environment has this path :
drive:\Qt\mingw\bin;drive:\Qt\Qt\qmake;drive:\Qt\q t\bin
(drive:\QT is where you install QT )
6.- Open a QT Command Prompt (from programs> QT>QT Command Prompt) . In my case, I have the next message.
Setting up a MinGW/Qt only environment...
-- QTDIR set to D:\Qt\qt
-- PATH set to D:\Qt\qt\bin
-- Adding D:\Qt\bin to PATH
-- Adding C:\WINNT\System32 to PATH
-- QMAKESPEC set to win32-g++
changedir to MyQtcreator.
7.- execute here this two commands (change D: by your drive)
qmake qtcreator.pro -spec win32-g++ -r CONFIG+=release
mingw32-make release
(I’m not sure that the release word for the second line does something, but at least it does not make me ache)
8.- After a time (1,2 hours I dont know exactly) you have done the work.
9.- The new QtCreator needs the QT....dll’s located at \Qt\qt\bin, so simply add this paths to PATH environment variable. The QT\Bin where old-original QTcreator.exe resides has some dll's but you need those placed at qt\qt\bin (sdk)
9.- Now we can run MyQtCreator\bin\qtcreator .
Might be well to organize the Qt\bin\folder (where is located the old QtCreator) but I’m not sure what can be neccesary, so by the moment I prefere to use MyQtCreator\bin.
also remains to organize the material in this folder. Now, after the compilation is full of files
I hope this helps to somebody
if I could have read it, I would have saved much time.
Excuse me for my poor english.
And ... finally, Nokia's do not waste people's time.
Bookmarks