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).
I considered drawing the buttons right in VTK but we want to use the QT styling and some of their more complex ui objects. Any suggestions?
The following minimal example shows the problem:
#include <QApplication.h> #include <QVTKWidget.h> #include <vtkSphereSource.h> #include <vtkPolyDataMapper.h> #include <vtkActor.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkRenderer.h> int main( int argc, char **argv )
QApplication app( argc, argv );
#if QT_VERSION < 0x040000
vtkRenderer *renderer = vtkRenderer::New();
vtkRenderWindow *renderWindow = vtkRenderWindow::New();
QLayout* gridLayout = new QGridLayout(&widget);
QPushButton button("Should show up");
>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).
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 [hidden email] Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
Powered by www.kitware.com