Detailed Description
The QGLMockView class exists purely for unit testing.
The QGLMockView class exists purely for unit test writing and should never be used for creating actual applications. QGLMockView is for advanced, mostly internal use and is not supported as part of the Qt3D functional API.
Member Function Documentation
QGLMockView::QGLMockView(QWindow * parent = 0)
Create a new QGLMockView object. Internally this sets up the underlying QWindow with some typical values useful for unit-testing, and then tries to create the window. If this fails the instance is invalid and it can be assumed the unit test environment does not support GL.
QGLMockView::~QGLMockView()
Destroys this QGLMockView object, recovering any resources.
Returns the QOpenGLContext for this mock view, if one exists.
By default this value is null, but the constructor will attempt to set it to a non-null and valid context, and then make that context current on this window.
QGLMockView view;
QCOMPARE(view.context(), QOpenGLContext::currentContext());
bool QGLMockView::isValid() const
Returns true if this QGLMockView object can be used for testing.
QGLMockView view;
if (!view.isValid())
QSKIP("GL not supported on this test platform");
The isValid() function will be false typically if the underlying GL context could not be created for this window.