AlexanderAlexander
AlexanderAlexander

Reputation: 101

Vtk charts break in QT, "no override found for 'vtkContextDevice2D"

I can't use any type of vtk 2D chart in QT without getting the error:
"Generic Warning: In vtkContextDevice2D.cxx, line 31 Error: no override found for 'vtkContextDevice2D".

There is limited discussion on this with almost all suggestions being to upgrade qt/vtk, but theses are year old and I am on the newest versions.

This doesn't help either:

include "vtkAutoInit.h"   
VTK_MODULE_INIT(vtkRenderingOpenGL2); // VTK was built with vtkRenderingOpenGL2  
VTK_MODULE_INIT(vtkInteractionStyle);  

Info: Win64 on 64bit machine, vtk8.2.0, Qt5.13.0, compiled/built in MCVS2017(Release x64) with cmake3.15.0
(Everything else works fine, even 3D renderings with vtk)

Code:

view->SetInteractor(this->qvtkWidgetRight->GetInteractor());  
this->qvtkWidgetRight->SetRenderWindow(view->GetRenderWindow());

What the error produces

Upvotes: 1

Views: 1314

Answers (1)

maidamai
maidamai

Reputation: 732

I had a similar problem when I run this example:QtBarChart, and I fixed this issue with linking with these vtk libraries:

find_package(VTK COMPONENTS
  vtkChartsCore
  vtkCommonCore
  vtkCommonDataModel
  vtkInteractionStyle
  vtkRenderingContext2D
  vtkRenderingContextOpenGL2
  vtkRenderingCore
  vtkRenderingFreeType
  vtkRenderingGL2PSOpenGL2
  vtkRenderingOpenGL2
  vtkViewsContext2D
  QUIET

It seems I missed some libraries.

Upvotes: 1

Related Questions