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:
To use a DLL in Designer it must be build with the same
compiler as Creator is. Look in ts About creator dialog
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 ...
Will be ok to download and install this instead?
Or .... ?
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?
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.
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.
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
first so it can find its Qt dlls.
setting QT_DEBUG_PLUGINS=1 before running Creator shows more info
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.
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 )
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?
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
And check that there are paths for it to get the
(i might rename the non debug dll to be sure its not loaded)
I would also inspect the debug .exe with
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
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.
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?
Yes promotion can be used for that.
then the sourced is just compiled with the rest of the program and have no further complications.