Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QVTKwidget not shown in QtDesigner
Forum Updated to NodeBB v4.3 + New Features

QVTKwidget not shown in QtDesigner

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 5 Posters 6.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike5500
    wrote on last edited by Mike5500
    #1

    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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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)

      1 Reply Last reply
      3
      • M Offline
        M Offline
        Mike5500
        wrote on last edited by Mike5500
        #3

        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?

        mrjjM 1 Reply Last reply
        0
        • M Mike5500

          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?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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.

          M 1 Reply Last reply
          2
          • mrjjM mrjj

            @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.

            M Offline
            M Offline
            Mike5500
            wrote on last edited by
            #5

            @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.

            mrjjM 1 Reply Last reply
            0
            • M Mike5500

              @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.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mike5500
                wrote on last edited by Mike5500
                #7

                @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.

                mrjjM 1 Reply Last reply
                1
                • M Mike5500

                  @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.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @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 )

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    Mike5500
                    wrote on last edited by
                    #9

                    @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?

                    mrjjM 1 Reply Last reply
                    0
                    • M Mike5500

                      @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?

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @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?

                      1 Reply Last reply
                      2
                      • M Offline
                        M Offline
                        Mike5500
                        wrote on last edited by Mike5500
                        #11

                        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

                        1 Reply Last reply
                        0
                        • mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

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

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            minjunkim
                            wrote on last edited by
                            #13

                            release mode QVTKWidet.dll import your qt creator or qt designer path

                            1 Reply Last reply
                            0
                            • Please_Help_me_DP Offline
                              Please_Help_me_DP Offline
                              Please_Help_me_D
                              wrote on last edited by
                              #14

                              Hello
                              I'm trying to compile VTK to use it in Qt. Now when building VTK with CMake I can see the following parameters:
                              --the maximum number of processors available to run MPI application (MPIEXEC_MAX_NUMPROCS)
                              --maximum number of threads vtkMultiThreader will allocate (VTK_MAX_THREADS)
                              --maximum number of processors available to run parallel application (VTK_MPI_MAX_NUMPROCS).
                              The default values are:
                              MPIEXEC_MAX_NUMPROCS = 2
                              VTK_MAX_THREADS = 64
                              VTK_MPI_MAX_NUMPROCS = 2

                              My computer has 2 cores, Windows 7 x64
                              If I'm going to use VTK as an external library to build my_app in Qt and in future use my_app on other computers that possibly have more than 2 cores and possibly use cluster calculations then should I change those parameters and set them to bigger values? What would you advise to me?

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                Hi,

                                I would advise to ask that to the VTK folks as they are the more knowledgeable about their library.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                3

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved