<div dir="auto">You have to add QVTKOpenGLWidget as a class that can be promoted to. O can make a screenshot of how you do it when I get home. You basically fill in the class name, base class and name of the header. Then you can pick it from the list of classes when promoting.<div dir="auto"><br></div><div dir="auto">Elvis</div></div><br><div class="gmail_quote"><div dir="ltr">Den fre 25 maj 2018 15:49Elvis Chen <<a href="mailto:elvis.chen@gmail.com">elvis.chen@gmail.com</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-CA" link="blue" vlink="#954F72"><div class="m_-1846321965188006252WordSection1"><p class="MsoNormal">Hi,</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank you very much.  The 2<sup>nd</sup> problem was indeed related to the layout. As for the 1<sup>st</sup> problem, I’ve tried to promote a widget but the “promote” button is always grayed-out in Qt Designer. I’ll have to look deeper into this issue.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Very much appreciated,</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Regards,</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span style="color:#212121"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">--</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">Elvis C.S. Chen, PhD, LEL</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121"> </span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">Imaging, Robarts Research Institute</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">Department of Electrical and Computer Engineering</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">Biomedical Engineering</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">Medical Biophysics, Western University</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">London, Ontario, Canada</span><span style="color:#212121"><u></u><u></u></span></p><p class="MsoNormal"><span style="color:#212121"><u></u> <u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="border:none;padding:0cm"><b>From: </b><a href="mailto:elvis.stansvik@orexplore.com" target="_blank" rel="noreferrer">Elvis Stansvik</a><br><b>Sent: </b>May 25, 2018 2:58 AM<br><b>To: </b><a href="mailto:elvis.chen@gmail.com" target="_blank" rel="noreferrer">Elvis Chen</a><br><b>Cc: </b><a href="mailto:vtkusers@vtk.org" target="_blank" rel="noreferrer">VTK Users</a><br><b>Subject: </b>Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicy questions</p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><div><div><p class="MsoNormal">Den tors 24 maj 2018 22:37Elvis Chen <<a href="mailto:elvis.chen@gmail.com" target="_blank" rel="noreferrer">elvis.chen@gmail.com</a>> skrev:</p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal">Hi all,</p><p class="MsoNormal"> </p><p class="MsoNormal">I have 2 questions related to the integration of QVTKOpenGLWidget into Qt Designer and sizing policy, I seek your help.</p><p class="MsoNormal"> </p><p class="MsoNormal">First of, I’ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 environment. I am using Visual Studio 2015 Enterprise edition, CMake 3.11.2, and vtk 9.0. Everything was compiled as 32bit application.</p><p class="MsoNormal"> </p><p class="MsoNormal">Question #1: </p><p class="MsoNormal"> </p><p class="MsoNormal">In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy QVTKWidgetPlugin.dll/pdb into a path that’s accessible to Qt Designer. There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, I do have access to QVTKWidget but not QVTKOpenGLWidget.</p><p class="MsoNormal"> </p><p class="MsoNormal">The generated .ui file hence contained QVTKWidget and I had to manually edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget.</p><p class="MsoNormal"> </p><p class="MsoNormal">Is this the correct way of doing things?  Is manual editing required?</p></div></div></blockquote></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I believe you're right in that there's no designer plugin for QVTKOpenGLWidget.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">What I usually do is insert a QOpenGLWidget in designer and the "promote" it to a QVTKOpenGLWidget. See <a href="http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets" target="_blank" rel="noreferrer">http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets</a></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Manual editing should not be required.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"> </p><p class="MsoNormal">Question #2:</p><p class="MsoNormal"> </p><p class="MsoNormal">I tried to follow VTK/Qt examples such as <a href="https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/" target="_blank" rel="noreferrer">https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/</a>.  Suppose I have generated a Qt app based on QMainWindow, with a QWidget as the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as seen on the example above).  This was accomplished using Qt Designer and the resulting .ui file resembles to the example above.</p><p class="MsoNormal"> </p><p class="MsoNormal">While it works, I am having difficulties in setting up the size policy.  In short, no matter what sizePolicy I set to both (or either) the QWidget and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the QVTKOpenGLWidget does not maximize.</p><p class="MsoNormal"> </p><p class="MsoNormal">Can anyone shed some light into this issue?  I can attach the .ui file if it is appropriate.</p></div></div></blockquote></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It sounds like you don't have a layout set on the centralWidget? Try setting it by selecting the centralWidget and using one of the layout buttons in the toolbars.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The containing widget must have a layout set for size policies to take effect.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">HTH</p></div><div><p class="MsoNormal">Elvis</p></div><div><div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"> </p><p class="MsoNormal">Any help is very much appreciated,</p><p class="MsoNormal"><span style="color:#212121"> </span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">--</span></p><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#212121">Elvis C.S. Chen, PhD, LEL</span></p><p class="MsoNormal"> </p></div></div></blockquote></div></div></div><p class="MsoNormal" style="margin-left:4.8pt">_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank" rel="noreferrer">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" rel="noreferrer">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" rel="noreferrer">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank" rel="noreferrer">http://markmail.org/search/?q=vtkusers</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="https://vtk.org/mailman/listinfo/vtkusers" target="_blank" rel="noreferrer">https://vtk.org/mailman/listinfo/vtkusers</a></p><p class="MsoNormal"><u></u> <u></u></p></div></div></blockquote></div>