本文整理汇总了Python中vistrails.gui.pipeline_view.QPipelineView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QPipelineView.__init__方法的具体用法?Python QPipelineView.__init__怎么用?Python QPipelineView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vistrails.gui.pipeline_view.QPipelineView
的用法示例。
在下文中一共展示了QPipelineView.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from vistrails.gui.pipeline_view import QPipelineView [as 别名]
# 或者: from vistrails.gui.pipeline_view.QPipelineView import __init__ [as 别名]
def __init__(self, parent=None):
""" QPipelineView(parent: QWidget) -> QPipelineView
Initialize the graphics view and its properties
"""
QPipelineView.__init__(self, parent)
self.setWindowTitle('Annotated Pipeline')
self.inspector = PipelineInspector()
示例2: __init__
# 需要导入模块: from vistrails.gui.pipeline_view import QPipelineView [as 别名]
# 或者: from vistrails.gui.pipeline_view.QPipelineView import __init__ [as 别名]
def __init__(self, parent, scene, single_output=False, include_module_ids=[]):
""" QReadOnlyPortSelectPipelineView(parent: QPipelineView,
scene: QGraphicsScene,
single_output: bool,
include_module_ids: list)
-> QReadOnlyPortSelectPipelineView
Create a read only pipeline view that only allows selection of ports from
the modules in include_module_ids. If single_output is True, only one
output port can be selected at a time.
"""
QPipelineView.__init__(self, parent)
self.single_output = single_output
self._shown = False
self._selected_input_ports = []
self._selected_output_ports = []
# Create custom scene
scene_copy = QPipelineScene(self)
scene_copy.controller = scene.controller
scene_copy.setupScene(scene.current_pipeline)
scene_copy.selectAll()
if include_module_ids:
# Remove modules not in the include list and associated connections
sel_modules, sel_connections = scene_copy.get_selected_item_ids()
for m_id in sel_modules:
if m_id not in include_module_ids:
scene_copy.remove_module(m_id)
for c_id in sel_connections:
if c_id not in scene_copy.get_selected_item_ids()[1]:
scene_copy.remove_connection(c_id)
# Hide configure button on modules
for item in scene_copy.selectedItems():
if isinstance(item, QGraphicsModuleItem):
for c_item in item.childItems():
if isinstance(c_item, QGraphicsConfigureItem):
c_item.setVisible(False)
# Unselect everything and use the newly created scene
scene_copy.clearSelection()
scene_copy.updateSceneBoundingRect()
self.setScene(scene_copy)
示例3: __init__
# 需要导入模块: from vistrails.gui.pipeline_view import QPipelineView [as 别名]
# 或者: from vistrails.gui.pipeline_view.QPipelineView import __init__ [as 别名]
def __init__(self, parent=None):
QPipelineView.__init__(self, parent)
self.setBackgroundBrush(CurrentTheme.QUERY_RESULT_BACKGROUND_BRUSH)
self.scene().set_read_only_mode(True)