Skip to content

Commit

Permalink
Test grabbuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Feb 6, 2024
1 parent 99dc266 commit bdf7144
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Fwk/AppFwk/cafViewer/cafViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,8 @@ bool caf::Viewer::isPerfInfoHudEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::Viewer::paintEvent( QPaintEvent* event )
void caf::Viewer::paintGL()
{
makeCurrent();

cvf::ref<cvf::OpenGLContext> myOglContext = cvfOpenGLContext();
CVF_CHECK_OGL( myOglContext.p() );
CVF_ASSERT( myOglContext->isContextValid() );
Expand Down Expand Up @@ -1205,6 +1203,8 @@ bool caf::Viewer::isShadersSupported()
//--------------------------------------------------------------------------------------------------
QImage caf::Viewer::snapshotImage()
{
return grabFramebuffer();

// Qt5 : Call paintEvent() manually to make sure invisible widgets are rendered properly
// If this call is skipped, we get an assert in cvf::FramebufferObject::bind()
paintEvent( nullptr );
Expand Down
2 changes: 1 addition & 1 deletion Fwk/AppFwk/cafViewer/cafViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public slots:

// Standard overrides. Not for overriding
void resizeGL( int width, int height ) override;
void paintEvent( QPaintEvent* event ) override;
void paintGL() override;

// Support the navigation policy concept
bool event( QEvent* e ) override;
Expand Down

0 comments on commit bdf7144

Please sign in to comment.