<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Den tors 24 maj 2018 22:37Elvis 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="#0563C1" vlink="#954F72"><div class="m_6984964229478484383WordSection1"><p class="MsoNormal">Hi all,</p><p class="MsoNormal"><u></u> <u></u></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"><u></u> <u></u></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"><u></u> <u></u></p><p class="MsoNormal">Question #1: </p><p class="MsoNormal"><u></u> <u></u></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"><u></u> <u></u></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"><u></u> <u></u></p><p class="MsoNormal">Is this the correct way of doing things? Is manual editing required?</p></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I believe you're right in that there's no designer plugin for QVTKOpenGLWidget.</div><div dir="auto"><br></div><div dir="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">http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets</a></div><div dir="auto"><br></div><div dir="auto">Manual editing should not be required.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-CA" link="#0563C1" vlink="#954F72"><div class="m_6984964229478484383WordSection1"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Question #2:</p><p class="MsoNormal"><u></u> <u></u></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"><u></u> <u></u></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"><u></u> <u></u></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 dir="auto"><br></div><div dir="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.</div><div dir="auto"><br></div><div dir="auto">The containing widget must have a layout set for size policies to take effect.</div><div dir="auto"><br></div><div dir="auto">HTH</div><div dir="auto">Elvis</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-CA" link="#0563C1" vlink="#954F72"><div class="m_6984964229478484383WordSection1"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any help is very much appreciated,</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"><u></u> <u></u></p></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div></div></div>