15 #ifndef niftkVLWidget_h
16 #define niftkVLWidget_h
19 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
20 #include <vlQt5/Qt5Widget.hpp>
22 #include <vlQt4/Qt4Widget.hpp>
25 #include <niftkVLExports.h>
47 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
48 class NIFTKVL_EXPORT
VLWidget :
public vlQt5::Qt5Widget {
50 VLWidget(QWidget* parent = NULL,
const QGLWidget* shareWidget = NULL, Qt::WindowFlags
f = 0)
51 : Qt5Widget(parent, shareWidget,
f) {
53 class NIFTKVL_EXPORT VLWidget :
public vlQt4::Qt4Widget {
55 VLWidget(QWidget* parent = NULL,
const QGLWidget* shareWidget = NULL, Qt::WindowFlags
f = 0)
56 : Qt4Widget(parent, shareWidget,
f) {
59 addEventListener(m_VLSceneView.get());
60 setRefreshRate(1000 / 30);
61 setContinuousUpdate(
false);
62 setMouseTracking(
true);
63 setAutoBufferSwap(
false);
64 setAcceptDrops(
false);
67 QGLContext* glctx =
new QGLContext(this->context()->
format(),
this);
68 QGLFormat fmt = this->context()->format();
69 fmt.setDoubleBuffer(
true );
70 #if QT_VERSION >= 0x040700
71 fmt.setProfile(QGLFormat::CompatibilityProfile);
74 glctx->setFormat(fmt);
76 this->setContext(glctx);
85 bool contextIsCurrent() {
return QGLContext::currentContext() == QGLWidget::context(); }
A vl::UIEventListener bound to a QGLWidget (niftk::VLWidget) managing all VL/Vivid rendering and opti...
Definition: niftkVLSceneView.h:70
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1238
GLAPI const GLubyte *GLAPIENTRY glGetString(GLenum name)
#define GL_VERSION
Definition: glew.h:688
Definition: niftkExceptionObject.h:21
GLclampf f
Definition: glew.h:3136