-
-
Notifications
You must be signed in to change notification settings - Fork 397
Closed
Description
I'm using MacOS 14.1.1 (23B81) on Apple M1 Pro, conda environment
- python 3.11
- pythonocc-core=7.7.2
- PySide6_Essentials=6.6.0
With the following minimal code I get a runtime error
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
from OCC.Display.SimpleGui import init_display
def _export_to_png(display):
# save to other format by changing extension of filename
display.View.Dump("./capture.png")
def minimal_display_shape_with_screencapture():
display, start_display, add_menu, add_function_to_menu = init_display()
box_shape = BRepPrimAPI_MakeBox(50, 30, 10).Shape()
display.DisplayShape(box_shape, update=True)[0]
add_menu("screencapture")
add_function_to_menu("screencapture", functools.partial(_export_to_png,display))
start_display()
File "/source/simply_display.py", line 275, in minimal_display_shape_with_screencapture
add_function_to_menu("screencapture", functools.partial(_export_to_png,display))
File "/envs/lib/python3.11/site-packages/OCC/Display/SimpleGui.py", line 247, in add_function_to_menu
win.add_function_to_menu(*args, **kwargs)
File "/envs/lib/python3.11/site-packages/OCC/Display/SimpleGui.py", line 220, in add_function_to_menu
_action = QtWidgets.QAction(
^^^^^^^^^^^^^^^^^
AttributeError: module 'PySide6.QtWidgets' has no attribute 'QAction'
It will run normally when I don't call add_function_to_menu
.