Results 1 to 3 of 3

Thread: This is a tutorial for Custom Widgets Plugin and/or compile QTcreator under mingw.

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default This is a tutorial for Custom Widgets Plugin and/or compile QTcreator under mingw.

    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 :

    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 .
    This little tutorial covers : (CWPlugins = Custom Widget Plugins)
    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.
    Last edited by tonnot; 17th November 2010 at 13:52.

  2. The following user says thank you to tonnot for this useful post:

    TorAn (17th November 2010)

  3. #2
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: This is a tutorial for Custom Widgets Plugin and/or compile QTcreator under mingw

    hola ! (se que hablas castellano... jeje... porque te he leido!)
    he seguido estas instrucciones.... paso a paso...
    igual con otras muchas que encuentro por internet...
    pero nada....

    al final me dice un mensaje de "entry point .... blabla bla.... qtcore4.dll"

    es desesperante que las instrucciones que trae el propio qtcreator para compilarlo no funcionen.......

  4. #3
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: This is a tutorial for Custom Widgets Plugin and/or compile QTcreator under mingw

    Szassz!

    Thank you for this detailed tutorial, great work.
    Do you think is it possible to find somewhere on the Internet a mingw based QtCreator?
    May be somebody should upload it somewhere.

    Thanks again,
    Tsá!

Similar Threads

  1. compile todo plugin in qtcreator
    By kabanek in forum Installation and Deployment
    Replies: 12
    Last Post: 31st December 2010, 13:12
  2. Compile Qtcreator with mingw ?
    By tonnot in forum Installation and Deployment
    Replies: 13
    Last Post: 3rd November 2010, 23:00
  3. Replies: 15
    Last Post: 24th October 2010, 16:29
  4. QtCreator on mac. How to add custom widgets?
    By MuzZviman in forum Qt Tools
    Replies: 0
    Last Post: 24th May 2010, 03:20
  5. Replies: 9
    Last Post: 15th October 2009, 11:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.