Skip to content

tvtk PipelineBrowser Attribute ui changes to _ui #734

@HowcanoeWang

Description

@HowcanoeWang

When I trying to generate a ivtk GUI interface by:

from tvtk.tools import ivtk

win = ivtk.IVTKWithCrustAndBrowser()
win.open()

I get an error:

Traceback (most recent call last):
File "D:/OneDrive/Program/Python/StudyArea/py3d/week1/view_pipeline.py", line 12, in
win.open()
File "D:\Virtualenv\py3d\lib\site-packages\pyface\i_window.py", line 166, in open
self._create()
File "D:\Virtualenv\py3d\lib\site-packages\pyface\ui\qt4\application_window.py", line 121, in _create
contents = self._create_contents(self.control)
File "D:\Virtualenv\py3d\lib\site-packages\pyface\split_application_window.py", line 43, in _create_contents
return self._create_splitter(parent)
File "D:\Virtualenv\py3d\lib\site-packages\pyface\ui\qt4\split_widget.py", line 59, in _create_splitter
splitter.addWidget(self._create_lhs(splitter))
File "D:\Virtualenv\py3d\lib\site-packages\tvtk\tools\ivtk.py", line 342, in _create_lhs
self.browser_scene = SceneWithBrowser(parent)
File "D:\Virtualenv\py3d\lib\site-packages\pyface\split_panel.py", line 36, in init
self.control = self._create_splitter(parent)
File "D:\Virtualenv\py3d\lib\site-packages\pyface\ui\qt4\split_widget.py", line 59, in _create_splitter
splitter.addWidget(self._create_lhs(splitter))
File "D:\Virtualenv\py3d\lib\site-packages\tvtk\tools\ivtk.py", line 209, in _create_lhs
return self.browser.ui.control
AttributeError: 'PipelineBrowser' object has no attribute 'ui'

And when I view the source code, the class PipelineBrower.ui doesn't exist, instead, it changes to ._ui

After modifing file tvtk\tools\ivtk.py line 209

return self.browser.ui.control

to

return self.browser._ui.control

That works
tim 20181108084520

Another bug you can see is that pipeline browser is poped up rather than embeded in the TVTK Scene GUI, in order to fix this, I have to coded like this:

from tvtk.tools import ivtk

win = ivtk.IVTKWithCrustAndBrowser()
win.open()

# fix this pop up bug
dialog = win.control.centralWidget().widget(0).widget(0)
from pyface.qt import QtCore
dialog.setwindowFlags(QtCore.Qt.WindowFlags(0x00000000))
dialog.show()

tim 20181108085454

May you help to fix these in the source code?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions