[vtkusers] QT Button on top of QVTKWidget Mac OS

Sean McBride sean at rogue-research.com
Fri Oct 21 11:06:31 EDT 2016

On Tue, 18 Oct 2016 09:04:08 -0700, Matt C said:

>I'm trying to display Qt buttons on top of a QVTKWidget.  This works correct
>in Linux but using 
>Mac OS 10.11.16, QT 4.8.7 and VTK 7.0 the buttons are invisible. (I can
>click them if I know where they are).

The canonical example of overlaying Cocoa controls on OpenGL content is:

Basically, you need to use not only NSViews but CALayers also.  VTK includes an NSView subclass, but does not include any CALayer subclass.  *It's something I'm hoping to do one day when I miraculously have free time.)  But it's not too hard to make your own CAOpenGLLayer subclass and tell the vtkrenderwindow to draw into it.  I know nothing about Qt, so getting that into the mix will be another wrinkle I'm sure!


Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada

More information about the vtkusers mailing list