You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Qt methods are not being wrapped correctly or the wrapping libraries are being loaded in the extension, since Qt properties and public slots are not available in Python.
This is verified when trying to invoke such ivars for the qSlicerTractographyDisplayModuleWidget class in a Python script, e.g.
(...)
# Download and load the data
(...)
m = slicer.util.mainWindow()
m.moduleSelector().selectModule("TractographyDisplay")
display_widget = slicer.util.findChildren(name="qSlicerTractographyDisplayModuleWidget")[0]
opacity = display_widget.opacity()
which yields
AttributeError: qSlicerTractographyDisplayWidget has no attribute named 'opacity'
Being able to write a Python script (test) for that class would potentially avoid regressions in that class (e.g. #229). Although a C++ test could be an option, the test data would need to be stored somewhere and be made available for the test; in Python, this task is done without requiring any additional work through the SampleData::downloadFromURL method.
Qt methods are not being wrapped correctly or the wrapping libraries are being loaded in the extension, since Qt properties and public slots are not available in Python.
This is verified when trying to invoke such ivars for the
qSlicerTractographyDisplayModuleWidget
class in a Python script, e.g.which yields
Being able to write a Python script (test) for that class would potentially avoid regressions in that class (e.g. #229). Although a C++ test could be an option, the test data would need to be stored somewhere and be made available for the test; in Python, this task is done without requiring any additional work through the
SampleData::downloadFromURL
method.A thread had been started on 3D Slicer's discourse: https://discourse.slicer.org/t/call-a-widgets-methods-in-python/33416/4
The text was updated successfully, but these errors were encountered: