简体   繁体   English

Vtk 图表在 QT 中中断,“未找到‘vtkContextDevice2D’的覆盖”

[英]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:我不能在 QT 中使用任何类型的 vtk 2D 图表而不出现错误:
"Generic Warning: In vtkContextDevice2D.cxx, line 31 Error: no override found for 'vtkContextDevice2D". “一般警告:在 vtkContextDevice2D.cxx 中,第 31 行错误:未找到“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.对此的讨论有限,几乎所有的建议都是升级 qt/vtk,但这些都是一年前的,我使用的是最新版本。

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信息:64 位机器上的 Win64,vtk8.2.0,Qt5.13.0,在 MCVS2017(Release x64)中编译/内置,使用 cmake3.15.0
(Everything else works fine, even 3D renderings with vtk) (其他一切都正常,甚至使用 vtk 进行 3D 渲染)

Code:代码:

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

What the error produces错误产生什么

I had a similar problem when I run this example: QtBarChart , and I fixed this issue with linking with these vtk libraries :我在运行这个例子时遇到了类似的问题: QtBarChart ,我通过链接这些vtk 库解决了这个问题:

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

It seems I missed some libraries.似乎我错过了一些图书馆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM