eryar / occQt

A simple OpenCASCADE Qt demo.
MIT License
280 stars 129 forks source link

about inherit an Open CASCADE View from a QGLWidget? #15

Closed mahaidong closed 5 years ago

mahaidong commented 5 years ago

I read this from https://www.opencascade.com/content/open-cascade-view-qglwidget

OCC does the necessary OpenGL pixel formatting and initialization on the QWidget. On the QGLWidget, Qt already has done the formatting. Once you pass the window handle of the QGLWidget to OCC it will override QGLWidget's pixel settings and write its own. So, essentially, you won't be having any benefit of using the QGLWidget in place of QWidget.

is it possible inherit an occ view from QWidget?

When I do this I got a compile error :-1: error: symbol(s) not found for architecture x86_64 . My computer is macbook

eryar commented 5 years ago

@mahaidong Yes, It is possible to inherit an occ view from QWidget, you can refer the occ Qt samples.

mahaidong commented 5 years ago

I checked it already. if I add setAttribute(Qt::WA_PaintOnScreen); to qwidget , it works.

thanks