1 QML运行结果
2 编译无警告和错误
3 修改pro文件
C/VTK/VTKTest at master · 975150313/C (github.com)
QT += quick quickcontrols2 qml
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
msvc:QMAKE_CXXFLAGS += /utf-8
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
HEADERS += \
qquickvtk.h \
qquickvtkrenderer.h
SOURCES += main.cpp \
qquickvtk.cpp \
qquickvtkrenderer.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/{
mathJaxContainer[0]}{
TARGET}/bin
!isEmpty(target.path): INSTALLS += target
INCLUDEPATH+="$$PWD"
#=====================================VTK_ITK===================================
INCLUDEPATH += "C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\include"
INCLUDEPATH += "C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\include\vtk-9.1"
INCLUDEPATH += "C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\include\vtk-9.1\vtkhdf5"
DEPENDPATH += "C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\bin"
DEPENDPATH += "C:\Qt\5.15.2\msvc2019_64\bin"
DEPENDPATH += "C:\Qt\5.15.2\msvc2019_64\qml"
#LIBS+= -L$$quote("C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib")
win32:LIBS += {
mathJaxContainer[2]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkChartsCore-9.1.lib)
win32:LIBS += {
mathJaxContainer[3]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkCommonComputationalGeometry-9.1.lib)
win32:LIBS += {
mathJaxContainer[4]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkCommonDataModel-9.1.lib)
win32:LIBS += {
mathJaxContainer[5]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkCommonMath-9.1.lib)
win32:LIBS += {
mathJaxContainer[6]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkCommonPython-9.1.lib)
win32:LIBS += {
mathJaxContainer[7]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkCommonTransforms-9.1.lib)
win32:LIBS += {
mathJaxContainer[8]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkDomainsChemistry-9.1.lib)
win32:LIBS += {
mathJaxContainer[9]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkdoubleconversion-9.1.lib)
win32:LIBS += {
mathJaxContainer[10]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkexpat-9.1.lib)
win32:LIBS += {
mathJaxContainer[11]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersCore-9.1.lib)
win32:LIBS += {
mathJaxContainer[12]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersFlowPaths-9.1.lib)
win32:LIBS += {
mathJaxContainer[13]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersGeneric-9.1.lib)
win32:LIBS += {
mathJaxContainer[14]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersHybrid-9.1.lib)
win32:LIBS += {
mathJaxContainer[15]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersImaging-9.1.lib)
win32:LIBS += {
mathJaxContainer[16]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersParallel-9.1.lib)
win32:LIBS += {
mathJaxContainer[17]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersPoints-9.1.lib)
win32:LIBS += {
mathJaxContainer[18]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersPython-9.1.lib)
win32:LIBS += {
mathJaxContainer[19]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersSMP-9.1.lib)
win32:LIBS += {
mathJaxContainer[20]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersStatistics-9.1.lib)
win32:LIBS += {
mathJaxContainer[21]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkFiltersTopology-9.1.lib)
win32:LIBS += {
mathJaxContainer[22]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkfmt-9.1.lib)
win32:LIBS += {
mathJaxContainer[23]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkGeovisCore-9.1.lib)
win32:LIBS += {
mathJaxContainer[24]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkglew-9.1.lib)
win32:LIBS += {
mathJaxContainer[25]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkGUISupportQtQuick-9.1.lib)
win32:LIBS += {
mathJaxContainer[26]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkhdf5-9.1.lib)
win32:LIBS += {
mathJaxContainer[27]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkImagingColor-9.1.lib)
win32:LIBS += {
mathJaxContainer[28]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkImagingFourier-9.1.lib)
win32:LIBS += {
mathJaxContainer[29]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkImagingHybrid-9.1.lib)
win32:LIBS += {
mathJaxContainer[30]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkImagingMorphological-9.1.lib)
win32:LIBS += {
mathJaxContainer[31]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkImagingStatistics-9.1.lib)
win32:LIBS += {
mathJaxContainer[32]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkInfovisCore-9.1.lib)
win32:LIBS += {
mathJaxContainer[33]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkInteractionImage-9.1.lib)
win32:LIBS += {
mathJaxContainer[34]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkInteractionWidgets-9.1.lib)
win32:LIBS += {
mathJaxContainer[35]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOAsynchronous-9.1.lib)
win32:LIBS += {
mathJaxContainer[36]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOChemistry-9.1.lib)
win32:LIBS += {
mathJaxContainer[37]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOCONVERGECFD-9.1.lib)
win32:LIBS += {
mathJaxContainer[38]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOEnSight-9.1.lib)
win32:LIBS += {
mathJaxContainer[39]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOExport-9.1.lib)
win32:LIBS += {
mathJaxContainer[40]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOExportPDF-9.1.lib)
win32:LIBS += {
mathJaxContainer[41]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOHDF-9.1.lib)
win32:LIBS += {
mathJaxContainer[42]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOImport-9.1.lib)
win32:LIBS += {
mathJaxContainer[43]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOIOSS-9.1.lib)
win32:LIBS += {
mathJaxContainer[44]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOLSDyna-9.1.lib)
win32:LIBS += {
mathJaxContainer[45]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOMotionFX-9.1.lib)
win32:LIBS += {
mathJaxContainer[46]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIONetCDF-9.1.lib)
win32:LIBS += {
mathJaxContainer[47]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOParallel-9.1.lib)
win32:LIBS += {
mathJaxContainer[48]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOPLY-9.1.lib)
win32:LIBS += {
mathJaxContainer[49]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOSQL-9.1.lib)
win32:LIBS += {
mathJaxContainer[50]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOTecplotTable-9.1.lib)
win32:LIBS += {
mathJaxContainer[51]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOVideo-9.1.lib)
win32:LIBS += {
mathJaxContainer[52]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkIOXMLParser-9.1.lib)
win32:LIBS += {
mathJaxContainer[53]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkjsoncpp-9.1.lib)
win32:LIBS += {
mathJaxContainer[54]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtklibharu-9.1.lib)
win32:LIBS += {
mathJaxContainer[55]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtklibxml2-9.1.lib)
win32:LIBS += {
mathJaxContainer[56]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtklz4-9.1.lib)
win32:LIBS += {
mathJaxContainer[57]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkmetaio-9.1.lib)
win32:LIBS += {
mathJaxContainer[58]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkogg-9.1.lib)
win32:LIBS += {
mathJaxContainer[59]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkParallelDIY-9.1.lib)
win32:LIBS += {
mathJaxContainer[60]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkpugixml-9.1.lib)
win32:LIBS += {
mathJaxContainer[61]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkPythonInterpreter-9.1.lib)
win32:LIBS += {
mathJaxContainer[62]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingContext2D-9.1.lib)
win32:LIBS += {
mathJaxContainer[63]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingCore-9.1.lib)
win32:LIBS += {
mathJaxContainer[64]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingGL2PSOpenGL2-9.1.lib)
win32:LIBS += {
mathJaxContainer[65]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingLabel-9.1.lib)
win32:LIBS += {
mathJaxContainer[66]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingOpenGL2-9.1.lib)
win32:LIBS += {
mathJaxContainer[67]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingSceneGraph-9.1.lib)
win32:LIBS += {
mathJaxContainer[68]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingVolume-9.1.lib)
win32:LIBS += {
mathJaxContainer[69]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkRenderingVtkJS-9.1.lib)
win32:LIBS += {
mathJaxContainer[70]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtksys-9.1.lib)
win32:LIBS += {
mathJaxContainer[71]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtktheora-9.1.lib)
win32:LIBS += {
mathJaxContainer[72]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkverdict-9.1.lib)
win32:LIBS += {
mathJaxContainer[73]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkViewsCore-9.1.lib)
win32:LIBS += {
mathJaxContainer[74]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkViewsQt-9.1.lib)
win32:LIBS += {
mathJaxContainer[75]}quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkWrappingTools-9.1.lib)
win32:LIBS += $$quote(C:\Users\pgjgg\Desktop\C++_learn\VTK-9.1.0\VTK-release\lib\vtkzlib-9.1.lib)
#=====================================VTK_ITK===================================
4 QML加VTK的失败尝试
报错:
qrc:/resources/main.qml:191: ReferenceError: fileUrl is not defined
在VS2019和QT5.15.2进行debug,没有解决。
尝试了如下方法:
import Qt.labs.platform 1.1
canvasHandler.openModel(file);
// bool isModelExtensionValid(const QUrl &modelPath) const;
bool isModelExtensionValid( QUrl modelPath) ;
类似的:
5 参考链接
(600条消息) 初步编译QT5.15.2+VS2019+VTK8.1.0_yantuguiguziPGJ的博客-CSDN博客
(587条消息) 三战VS2019编译VTK7.1+Qt5.15.2_yantuguiguziPGJ的博客-CSDN博客
(587条消息) VTK笔记-Qt5.12.11编译VTK9.0.3-QVTKOpenGLNativeWidget_黑山老妖的博客-CSDN博客
(587条消息) QQuick Vtk QML C++_douzi949389的博客-CSDN博客
(600条消息) VTK9.1.0在Windows10+VS2019+Qt 5.15.2环境下编译安装以及VTK应用于QT_isongxw的博客-CSDN博客