<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.gmail-hoenzb
{mso-style-name:gmail-hoenzb;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-CA link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Thank you. My mistake was that I was using QWidget (instead of QOpenGLWidget) as the base widget. Now it works great.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Really appreciated.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#212121'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial",sans-serif;color:#212121'>--</span><span style='color:#212121'><o:p></o:p></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'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial",sans-serif;color:#212121'> </span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial",sans-serif;color:#212121'>Imaging, Robarts Research Institute</span><span style='color:#212121'><o:p></o:p></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'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial",sans-serif;color:#212121'>Biomedical Engineering</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial",sans-serif;color:#212121'>Medical Biophysics, Western University</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial",sans-serif;color:#212121'>London, Ontario, Canada</span><span style='color:#212121'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#212121'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;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">Elvis Stansvik</a><br><b>Sent: </b>May 25, 2018 12:49 PM<br><b>To: </b><a href="mailto:elvis.chen@gmail.com">Elvis Chen</a><br><b>Cc: </b><a href="mailto:vtkusers@vtk.org">VTK Users</a><br><b>Subject: </b>Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicyquestions</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Here's how you do it:</p></div><p class=MsoNormal>Step 1: Right-click the QOpenGLWidget and pick "Promote to...":</p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><img border=0 width=562 height=316 style='width:5.8541in;height:3.2916in' id="_x0000_i1028" src="cid:ii_jhm75l9g4_16398305264df350" alt="cid:ii_jhm75l9g4_16398305264df350"></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Step 2: Fill in base class, class name and header name and click "Add":</p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><img border=0 width=562 height=316 style='width:5.8541in;height:3.2916in' id="_x0000_i1027" src="cid:ii_jhm75l9q5_16398305264df350" alt="cid:ii_jhm75l9q5_16398305264df350"></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Step 3: With the new entry selected in the list, click "Promote":</p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><img border=0 width=562 height=316 style='width:5.8541in;height:3.2916in' id="_x0000_i1026" src="cid:ii_jhm75la06_16398305264df350" alt="cid:ii_jhm75la06_16398305264df350"></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Step 4: Done, the class is now promoted to a QVTKOpenGLWidget:</p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><img border=0 width=562 height=316 style='width:5.8541in;height:3.2916in' id="_x0000_i1025" src="cid:ii_jhm75laa7_16398305264df350" alt="cid:ii_jhm75laa7_16398305264df350"></p></div><div><p class=MsoNormal>HTH,</p></div><div><p class=MsoNormal>Elvis</p></div><p class=MsoNormal></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>2018-05-25 18:27 GMT+02:00 Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>>:</p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><p class=MsoNormal>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.<span class=gmail-hoenzb><span style='color:#888888'><o:p></o:p></span></span></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='color:#888888'>Elvis<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Den fre 25 maj 2018 15:49Elvis Chen <<a href="mailto:elvis.chen@gmail.com" target="_blank">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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi,</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Very much appreciated,</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regards,</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#212121'> </span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>--</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>Elvis C.S. Chen, PhD, LEL</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'> </span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>Imaging, Robarts Research Institute</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>Department of Electrical and Computer Engineering</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>Biomedical Engineering</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>Medical Biophysics, Western University</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>London, Ontario, Canada</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#212121'> </span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;border-color:currentcolor currentcolor'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From: </b><a href="mailto:elvis.stansvik@orexplore.com" target="_blank">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">Elvis Chen</a><br><b>Cc: </b><a href="mailto:vtkusers@vtk.org" target="_blank">VTK Users</a><br><b>Subject: </b>Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicy questions</p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Den tors 24 maj 2018 22:37Elvis Chen <<a href="mailto:elvis.chen@gmail.com" target="_blank">elvis.chen@gmail.com</a>> skrev:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid windowtext 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi all,</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have 2 questions related to the integration of QVTKOpenGLWidget into Qt Designer and sizing policy, I seek your help.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Question #1: </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is this the correct way of doing things? Is manual editing required?</p></div></div></blockquote></div></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I believe you're right in that there's no designer plugin for QVTKOpenGLWidget.</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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">http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets</a></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Manual editing should not be required.</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><div><blockquote style='border:none;border-left:solid windowtext 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Question #2:</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I tried to follow VTK/Qt examples such as <a href="https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/" target="_blank">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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The containing widget must have a layout set for size policies to take effect.</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>HTH</p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Elvis<o:p></o:p></p></div><div><div><blockquote style='border:none;border-left:solid windowtext 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Any help is very much appreciated,</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#212121'> </span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>--</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Arial",sans-serif;color:#212121'>Elvis C.S. Chen, PhD, LEL</span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div></div></blockquote></div></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">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">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">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">https://vtk.org/mailman/listinfo/vtkusers</a></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p></div></div></blockquote></div></div></div></blockquote></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>