QVTKOpenGLWidget and QWidgets

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

QVTKOpenGLWidget and QWidgets

Sam Raby
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: QVTKOpenGLWidget and QWidgets

Sam Raby
Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic.

Thanks


On Friday, May 4, 2018, Sam Raby <[hidden email]> wrote:
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: QVTKOpenGLWidget and QWidgets

pdhahn
Sounds like a problem with event processing based on widget focus. Sorry for this generality which is probably not too helpful. But speaking just a tad bit sarcastically, I think eventually the answer you **might** get on this forum from a knowledgeable VTK person (that's not me, sorry) will be "look at ParaView to see how things are done with Qt there". So you might try that IMHO.  :-)

As for me, I am researching alternatives to Qt with VTK. I will be trying IMGUI because it is "immediate mode" and hopefully will avoid issues like this. The downside is that IMGUI widgets stink in terms of appearance. Over all, Qt is by far the most polished and mature UI toolkit out there in my experience (speaking as a self-rated Qt expert, at least Qt4). But speaking a tad bit sarcastically again, I think using VTK with any UI toolkit seems to have its fair share of challenges and mysteries. I have posed a number of questions about alternatives to Qt in this forum and have had no useful response.

On 05/04/2018 04:01 PM, Sam Raby wrote:
Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic.

Thanks


On Friday, May 4, 2018, Sam Raby <[hidden email]> wrote:
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S

                      





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers


-- 
Paul D. Hahn
CompIntense HPC, LLC

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: QVTKOpenGLWidget and QWidgets

VTK - Users mailing list
In reply to this post by Sam Raby
Is the checkbox widget placed within the render window boundary?

It sounds like the vtk render window is capturing the mouse events. I'm not familiar with Qt but it seems that the solution would be to grab the mouse event position in your vtk render widow event handler and reroute the event to the widget that bounds that location.

On 5 May 2018 9:01 a.m., Sam Raby <[hidden email]> wrote:
Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic.

Thanks


On Friday, May 4, 2018, Sam Raby <[hidden email]> wrote:
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S






_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: QVTKOpenGLWidget and QWidgets

Sam Raby
The solution I found was to d
isable multisampling on the 
QSurfaceFormat before setting the default surface format, meaning to
 replace the following:

QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

with the following:

QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat();
fmt.setSamples(0);
QSurfaceFormat::setDefaultFormat(fmt);

This was a solution to another problem that I found on this link: http://vtk.1045678.n5.nabble.com/Issues-using-QVTKOpenGLWidget-td5745401.html

Would anyone explain why this fixes the issue and if there is any consequence to this?

Thanks
 



On Sat, May 5, 2018 at 5:20 PM, Todd <[hidden email]> wrote:
Is the checkbox widget placed within the render window boundary?

It sounds like the vtk render window is capturing the mouse events. I'm not familiar with Qt but it seems that the solution would be to grab the mouse event position in your vtk render widow event handler and reroute the event to the widget that bounds that location.

On 5 May 2018 9:01 a.m., Sam Raby <[hidden email]> wrote:
Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic.

Thanks


On Friday, May 4, 2018, Sam Raby <[hidden email]> wrote:
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S







_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: QVTKOpenGLWidget and QWidgets

Shawn Waldon-2
Hi Sam,

I know there are still some issues with the QVTKOpenGLWidget, but I've never heard of this one before.  There is ongoing work [1] to improve the QVTKOpenGLWidget.  You might try building with that branch and see if it improves things.

Shawn

[1]: https://gitlab.kitware.com/vtk/vtk/merge_requests/3745

On Sun, May 6, 2018 at 10:15 AM, Sam Raby <[hidden email]> wrote:
The solution I found was to d
isable multisampling on the 
QSurfaceFormat before setting the default surface format, meaning to
 replace the following:

QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

with the following:

QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat();
fmt.setSamples(0);
QSurfaceFormat::setDefaultFormat(fmt);

This was a solution to another problem that I found on this link: http://vtk.1045678.n5.nabble.com/Issues-using-QVTKOpenGLWidget-td5745401.html

Would anyone explain why this fixes the issue and if there is any consequence to this?

Thanks
 



On Sat, May 5, 2018 at 5:20 PM, Todd <[hidden email]> wrote:
Is the checkbox widget placed within the render window boundary?

It sounds like the vtk render window is capturing the mouse events. I'm not familiar with Qt but it seems that the solution would be to grab the mouse event position in your vtk render widow event handler and reroute the event to the widget that bounds that location.

On 5 May 2018 9:01 a.m., Sam Raby <[hidden email]> wrote:
Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic.

Thanks


On Friday, May 4, 2018, Sam Raby <[hidden email]> wrote:
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S







_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: QVTKOpenGLWidget and QWidgets

Elvis Stansvik
In reply to this post by Sam Raby
I think what you will lose is MSAA (Multi-sampling anti aliasing). FXAA is another approach to AA if you need that.

(I also run with samples hard-set to 0, because I think I had problems with volume rendering on some graphics cards (volume would not show up), or perhaps it was a problem with mixing volumes and polys, I can't remember. In any case I should revisit whether it's still necessary.)

Elvis




Den sön 6 maj 2018 16:16Sam Raby <[hidden email]> skrev:
The solution I found was to d
isable multisampling on the 
QSurfaceFormat before setting the default surface format, meaning to
 replace the following:

QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

with the following:

QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat();
fmt.setSamples(0);
QSurfaceFormat::setDefaultFormat(fmt);

This was a solution to another problem that I found on this link: http://vtk.1045678.n5.nabble.com/Issues-using-QVTKOpenGLWidget-td5745401.html

Would anyone explain why this fixes the issue and if there is any consequence to this?

Thanks
 



On Sat, May 5, 2018 at 5:20 PM, Todd <[hidden email]> wrote:
Is the checkbox widget placed within the render window boundary?

It sounds like the vtk render window is capturing the mouse events. I'm not familiar with Qt but it seems that the solution would be to grab the mouse event position in your vtk render widow event handler and reroute the event to the widget that bounds that location.

On 5 May 2018 9:01 a.m., Sam Raby <[hidden email]> wrote:
Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic.

Thanks


On Friday, May 4, 2018, Sam Raby <[hidden email]> wrote:
 

I am running the following example of using QVTKOpenGLWidget to display a sphere. 


It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code:

    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());

Thanks
S






_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers