QVTKwidget not shown in QtDesigner



  • I have a problem with a widget compiled outside Qt. It isnt shown in QtDesigner.
    I have copied the QVTKWidgetPlugin.dll to C:\Qt\Qt5.6.2\5.6\msvc2015_64\plugins\designer
    However the QVTKWidget is not shown in Qt Designer. Why?
    Someone having a solution to this?

    (I use the open source version of QT. Qt5.6.2)

    This is the widget I have problems with:
    https://translate.googleusercontent.com/translate_c?act=url&depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&sp=nmt4&tl=en&u=https://gist.github.com/UnaNancyOwen/77d61f9f21376c9b59fc&usg=ALkJrhijJfbB3d12ESJNgeU6X24DXQ1hBQ#file-qvtk7-md


  • Qt Champions 2016

    Hi
    To use a DLL in Designer it must be build with the same
    compiler as Creator is. Look in ts About creator dialog

    alt text

    So if you build the plugin in anything but vs2015, 32 bit (if your creator says the same)
    then it wont work.

    Also it needs to be release mode.

    set QT_DEBUG_PLUGINS=1 before you start Creator to get more info on why its not loading.

    Since you path says msvc2015_64 i suspect that is the reason.
    Must be a 32 bit plugin. (This is my data, look in your About)



  • AHA !!!! Thanks for that info @mrjj

    I have the 32 bit Qt creator yes ...

    0_1508692177648_9a5552be-d4b1-4129-aae6-5244cead29d3-image.png

    Will be ok to download and install this instead?
    http://download.qt.io/official_releases/qt/5.6/5.6.3/qt-opensource-windows-x86-msvc2015_64-5.6.3.exe
    Or .... ?

    Debugger:
    I need to have the debugger to do coding. Does this mean that if I use the QVTKwidget I cant do any work with the debug versions of my own code and start the debugger or does it mean that I am simply unable to see symbols inside the QVTKWidget.dll when i run the debugger?


  • Qt Champions 2016

    @Mike5500
    Hi
    For that creator you need to compile the plugin with 2013 VS.
    and 32 bit.

    Regarding the debug version, it will try to load the debug version of
    Qts dlls. I have some issues with that and with Designer plugins.
    It might work better for you.



  • @mrjj

    I was able to compile it in release mode with MSVC2015 64 bit. However the widget didn' t show in Designer left window but it worked. I will try as well a later version of qt (5.9.2)

    Can this debug problem be solved? (I got some Qt*-d.dll missing errors earlier when i tried to start the generated .exe on the cmd line yes)

    I really need to be able to debug my own code while using this QVTKwidget.


  • Qt Champions 2016

    @Mike5500
    If it did not not show it, in what did it work then?

    Clicking the exe / start from commandline is another issue.
    To start from cmd, run
    "C:\Qt\5.9.1\msvc2015_64\bin\qtenv2.bat"
    first so it can find its Qt dlls.

    setting QT_DEBUG_PLUGINS=1 before running Creator shows more info



  • @mrjj

    I used the .pro file and files from the project from this guy: https://github.com/UnaNancyOwen/qt_visualizer

    I did edit it a bit so it could work in the newer environments, as described here: http://unanancyowen.com/en/pcl-with-qt/

    It didn't show the QVTKWidget in the designer left side, but on the main window the widget was shown. When running the code (in release mode) it worked. (Earlier, the QVTKwidget was also shown in the left side of designer, but that suddenly disappeared ... dont know why ... Have seen other people describe similar things happening)

    I used the all in one installer from this guy above so didnt have to recompile anything else than VTK and PCL.


  • Qt Champions 2016

    @Mike5500

    Just a note. If the projects include the widget directly it will work regardless of Qt used.
    If you want to see it in Designer, the plugin must be compiled with same
    compiler as the one used for Qt and also same Qt as Creator. ( to some degree )



  • @mrjj
    To be a bit more detailed, we have the problem that we cannot run debug version of this pcl visualization demo https://github.com/UnaNancyOwen/qt_visualizer (we get a crash when trying to run it in the debugger).

    When run in the debugger:
    Exception at 0x7fffff2e8238, code: 0xc0000005: read access violation at:
    0x0, flags=0x0 (first chance)

    The release version runs fine it looks like.

    I have read somewhere that this type of crash may be to some mixup between debug
    version of libraries and release version of libraries but I am not sure.

    The VTK library files are in C:\Program Files\VTK\bin
    Note: there are both vtkCommonCore-8.0.dll AND vtkCommonCore-8.0-gd.dll in
    the same bin directory. However the debug files are separated by having a *-gd.dll type of filename.

    Any suggestion towards what to do and where to look to get the debug version to work?


  • Qt Champions 2016

    @Mike5500
    Ok, it though it was about the Designer plugin.

    Yes, mixing DLL and DLL-d for Qt might give crashes and even not a sure thing , its just best not to mix.

    I would check:
    Place a break point at main() and see if it crashes before reaching it.
    If it crashes before, its most likely DLL related.

    Then I would check the run environment under Projects for the compiler/debug mode
    alt text

    And check that there are paths for it to get the
    C:\Program Files\VTK\bin
    (i might rename the non debug dll to be sure its not loaded)

    I would also inspect the debug .exe with
    http://www.dependencywalker.com/
    and study what its going to load.

    Also just to be sure to ask.
    You did compile the vtkCommonCore-8.0-gd.dll yourself with the same compiler as the
    for the actual app it self?



  • I was finnaly able to debug and compile and run the PCL visualization demo doing as I posted in this thread
    https://forum.qt.io/topic/84542/debug-and-release-version-of-dll-conflict-in-qt-5-9-2-how-to-debug-and-solve/10.

    However the QVTKwidet is still not shown in the qt designer. There are dragging handles there, but nothing in the available widgets - In any case it seems to work.

    0_1509449117668_32f0c9c4-687a-40a7-86f5-08ebb1ed6b59-image.png

    I reacall reading something about promoting an other widget to a QVTKwidget somewhere else. Could that be the solution to inserting QVTKwidgets into a Qt Gui with Qt designer without having compiled the QVTKwidget with the same compiler that Qt was compiled with?

    0_1509448974548_243cdc69-b9eb-494d-a41f-d1c92a1d0239-image.png


  • Qt Champions 2016

    Yes promotion can be used for that.
    then the sourced is just compiled with the rest of the program and have no further complications.


Log in to reply
 

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