<html 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)"><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;}
.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>Hi,</p><p class=MsoNormal><o:p> </o:p></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><o:p> </o:p></p><p class=MsoNormal>Very much appreciated,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,</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 2:58 AM<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 sizepolicy questions</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><div><p class=MsoNormal>Den tors 24 maj 2018 22:37Elvis Chen <<a href="mailto:elvis.chen@gmail.com">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 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><o:p> </o:p></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><o:p> </o:p></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">http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets</a></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Manual editing should not be required.</p></div><div><p class=MsoNormal><o:p> </o:p></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 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><o:p> </o:p></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><o:p> </o:p></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><o:p> </o:p></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 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='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><o:p> </o:p></p></div></body></html>