使用 occ 7.4.0 版本,pyqt5, 解决了init 缺少window_handle 的问题,另外添加一个左边的显示窗口
import ctypes
import logging
import os
import sys
from OCC.Display import OCCViewer
from PyQt5 import QtCore, QtGui, QtOpenGL, QtWidgets
# check if signal available, not available
# on PySide
HAVE_PYQT_SIGNAL = hasattr(QtCore, 'pyqtSignal')
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
log = logging.getLogger(__name__)
class qtBaseViewer(QtOpenGL.QGLWidget):
# class qtBaseViewer(QtWidgets.QWidget):
''' The base Qt Widget for an OCC viewer
'''
def __init__(self, parent=None):
super(qtBaseViewer, self).__init__(parent)
# 获取 GUI 窗口句柄
# window_handle = pyautogui.getActiveWindow().winId()