Qt5 - QtCreator doesn't load custom widget



  • Hello, everyone!

    I have followed the custom widget tutorial in the QT5 docs ("http://qt-project.org/doc/qt-5.0/qtdesigner/customwidgetplugin.html":http://qt-project.org/doc/qt-5.0/qtdesigner/customwidgetplugin.html).

    I compile without errors. I put the resuling dll in the custom widget folder (C:\Qt\Qt5.0.1\Tools\QtCreator\bin\designer).

    The result: it doesn't appear in the widget box, in Qt designer.

    Anybody know what could be happening here?

    Thanks in advance for your time and your answers.



  • Make sure that the plugin is build with the same version i.e Qt.5.0.x and not with the previous Qt 4.8.x , if you have multiple installation then that too causes a problem.

    You can check on Qt designer if the plugin is loaded or not
    Tools -> Form Editor -> About Qt Designer Plugins



  • I can't find that option inside my Tools menu. I have built the plugin with the Mingw version of qt5 available in the since a few days.



  • I have the same problem! I installed the latest package "Qt 5.0.1 for Windows 32-bit (MinGW 4.7, 823 MB)" from the website. What can i do?



  • Open the form(or a dialog) in QtCreator (Designer).Go to "Tools/Form Editor/About QtDesigner Plugins". And see if QtCreator can find your customWidgets. If yes, What's the Error that is given there?



  • There is some common errors that may occurred:

    1. If your customWidget has a dependency, the dll of dependency have to be in path of windows or place it somewhere that qmake can find it
    2. your QtCreator has to be built with the same version of Qt and same compiler have to be used(both mingw or both msvc)
    3. You have to build your plugin in release mode
    4. you have to put your dll in following paths:
      a- Qt-root/msvc(or mingw)/plugins/designer
      b- Qt-root/tools/QtCreator/bin/designer


  • Hello!

    What about this path? C:\Qt\5.0.1\plugins\designer. I'm not sure if it will work, but I think that's the way it worked in 4.8.4.

    Regards



  • I've mentioned it ! but you have to add dll into another path in tools/QtCreator/bin/designer



  • :S I don't have that path... No QtCreator folder inside tools/

    Is something new about Qt5.0.0?



  • If you install your Qt from binary version you will have that path. But if you built your Qt: find folder location of QtCreator.



  • at this time i use the custom widget example from the Qt5 documentation. So there should not be some dependencies to external dlls.
    The output from "About QtDesigner Plugins Info":
    Cannot load library C:/Qt/Qt5.0.1/Tools/QtCreator/bin/designer/customwidgetplugin.dll: The procedure can't be find.
    There was no system path set after installation, so i set it to the designer's plugin directory C:\Qt\Qt5.0.1\Tools\QtCreator\bin\designer.
    I hope the QtCreator from the binary package is build with the same Qt version and is build with mingw! :-) At the time of Qt 4.6 it wasn't so, we have to build the custom widgets with msvc! But would this the case, i think there would be a other error message as i mentioned before.
    Yes the widget is build in release mode!
    I already copied the dll to C:\Qt\Qt5.0.1\Tools\QtCreator\bin\designer and C:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins\designer.
    Because of your hint, i created the subdirectory /plugins/designer in C:\Qt\Qt5.0.1 and copied the dll into it => same error message!

    Thanks for your help, but have somebody other ideas?
    Is there somebody who uses custom widets with Qt 5.x?



  • [SOLVED] I have this exact problem with QScintilla designer plugin.dll.

    1. I have Qt sdk 5.2.1
    2. I have compiled Qt Creator from source with Qt 5.2.1 CMD console using mingw32-make && mingw32-make install. All went good.

    How ever the GCC Creator says at tools-Form Editor-> About plugins:

    Cannot load library C:/Qt/Qt5.2.1/5.2.1/mingw48_32/plugins/designer/qscintillaplugin.dll: The specified module could not be found.

    I have compiled with same QT CMD console the qscintilla2.dll with mingw32-make && mingw32-make install. So the dll should be available for the Qt5.2.1 evironment. What is wrong here why Creator cannot load the plugin?



  • I have resovled the issue.

    I needed to copy lib.dll to qtcreator/bin

    then plugin.dll at default sdk/plugins/designer

    Now it works like a charm.


  • Moderators

    Thanks for posting your solution here.

    Could you please edit your first post and add [solved] to it?



  • I have same problem:
    i have QScintilla:

    qmake designer.pro
    C:\Qt\Tools\mingw48_32\bin\mingw32-make -f Makefile.Release
    C:\Qt\Tools\mingw48_32\bin\mingw32-make install

    Now i have this files:
    in ../release/:

    1. libqscintillaplugin.a
    2. moc_qscintillaplugin.cpp
    3. moc_qscintillaplugin.o
    4. qscintillaplugin.o
    5. qscintillaplugin.dll

    I copied qscintillaplugin.dll in C:/Qt/Qt5.2.1/5.2.1/mingw48_32/plugins/designer/

    and i view:
    in tools-Form Editor-> About plugins:

    Cannot load library C:/Qt/Qt5.2.1/5.2.1/mingw48_32/plugins/designer/qscintillaplugin.dll: The specified module could not be found.

    PLZ help me :(



  • Are you using linux or windows? Are us using default Qt Creator which came from MinGW Windows sdk?

    These conditions have to met when using designer plugins:

    1. Qt sdk need to be build with your compiler (MinGW)
    2. Qt Creator need to be build with your compiler (MinGW)
    3. QScintilla Designer and Lib plugins needed to compile with your compiler (MinGW)

    Other way the STDCALL will not work because name mangels different in GNU and MSVC.

    You need to copy these to make designer plugin work:

    1. QScintilla2.dll to tools/QtCreator-MinGW/bin
    2. qscintillaplugin.dll to sdk/plugins/designer


  • I'm having the same problem with Qscintilla 2.8.3,
    I'm using Qt5.2.0 with MingGw4.8, I followed the same instructions while making the files with MinGw32-make & MinGw32 Make install, I copied the files as follow:
    qsintillaplugin.dll to : 1-: C:\Qt\Qt5.2.0\5.2.0\mingw48_32\plugins\designer
    2-: C:\Qt\Qt5.2.0\Tools\QtCreator\bin\plugins\designer
    qsintilla2.dll to: C:\Qt\Qt5.2.0\Tools\QtCreator\bin

    the tools-Form Editor-> About plugins displays:
    Cannot load library
    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\plugins\designer\qsintillaplugin.dll: The specified module could not be found

    in a console application it works fine I can use the editor but I need it within the designer to make GUI application

    any help?



  • Hello,

    I'm having the same problem and have not been able to extract a solution out of previous posts. I have followed the procedure described to have an integrable widget in qt designer, had it compile fine and detected by qt designer.
    I first had an error due to the fact that I had built my library in debug rather than release but now I have built the library in release mode.
    Going in Tools/Form Editor/ About... I see my plugin with error message :
    Could not load ... library, the specified module could not be found.

    Any help would be appreciated !



  • Hello,

    I'm having the same problem and have not been able to extract a solution out of previous posts. I have followed the procedure described to have an integrable widget in qt designer, had it compile fine and detected by qt designer.
    I first had an error due to the fact that I had built my library in debug rather than release but now I have built the library in release mode.
    Going in Tools/Form Editor/ About... I see my plugin with error message :
    Could not load ... library, the specified module could not be found.

    Any help would be appreciated !


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Does your plugin have any dependency ? Did you compile it using the same compiler as your Qt Creator version ?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Does your plugin have any dependency ? Did you compile it using the same compiler as your Qt Creator version ?



  • Hi and thank you for your greeting,

    I don't think my plugin has any dependency, actually I took the exemple from qt documentation : the worldclock example.
    I tried with two Qt installs, the first one was "qt-opensource-windows-x86-1.6.0-5-online" - I don't know how it was compiled - and the second "one qt-opensource-windows-x86-mingw491_opengl-5.4.0" which I'm guessing is compiled using mingw. My plugin is compiled with mingw. I get the same message with both.



  • Hi and thank you for your greeting,

    I don't think my plugin has any dependency, actually I took the exemple from qt documentation : the worldclock example.
    I tried with two Qt installs, the first one was "qt-opensource-windows-x86-1.6.0-5-online" - I don't know how it was compiled - and the second "one qt-opensource-windows-x86-mingw491_opengl-5.4.0" which I'm guessing is compiled using mingw. My plugin is compiled with mingw. I get the same message with both.


  • Lifetime Qt Champion

    Unless it changed recently, Qt Creator is built with VS2010 so you have two options:

    Change your compiler

    Build Qt Creator yourself

    IIRC, you should also use the same Qt version that was used for Qt Creator (shown in the about box)

    Since you are creating a custom plugin, you should consider option 2 so you'll have both matching Qt and compiler


  • Lifetime Qt Champion

    Unless it changed recently, Qt Creator is built with VS2010 so you have two options:

    Change your compiler

    Build Qt Creator yourself

    IIRC, you should also use the same Qt version that was used for Qt Creator (shown in the about box)

    Since you are creating a custom plugin, you should consider option 2 so you'll have both matching Qt and compiler


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.