当前位置: 首页>>代码示例>>Python>>正文


Python pipeline_view.QPipelineView类代码示例

本文整理汇总了Python中vistrails.gui.pipeline_view.QPipelineView的典型用法代码示例。如果您正苦于以下问题:Python QPipelineView类的具体用法?Python QPipelineView怎么用?Python QPipelineView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QPipelineView类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mousePressEvent

 def mousePressEvent(self, event):
     """ mousePressEvent(event: QMouseEvent) -> None
     Toggle port selection
     
     """
     buttons = self.translateButton(event)
     if buttons == QtCore.Qt.LeftButton:
         scenePos = self.mapToScene(event.pos())
         item = self.scene().itemAt(scenePos)
         if isinstance(item, QAbstractGraphicsPortItem):
             is_input = item.port.type == 'input'
             if self.single_output and not is_input and len(self._selected_output_ports) > 0 and item != self._selected_output_ports[0]:
                 # Deselect current output port if another port selected in single output mode
                 self._selected_output_ports[0].setSelected(False)
                 del self._selected_output_ports[:]
             if is_input:
                 port_set = self._selected_input_ports
             else:
                 port_set = self._selected_output_ports
             if item in port_set:
                 port_set.remove(item)
             else:
                 port_set.append(item)
             self._clicked_port = item
         else:
             self._clicked_port = None
         event.accept()
     else:
         QPipelineView.mousePressEvent(self, event)
开发者ID:cjh1,项目名称:VisTrails,代码行数:29,代码来源:pipeline_view_select.py

示例2: __init__

 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()
开发者ID:alexmavr,项目名称:VisTrails,代码行数:8,代码来源:pe_pipeline.py

示例3: set_controller

 def set_controller(self, controller):
     QPipelineView.set_controller(self, controller)
     if not hasattr(self.controller, 'loaded_workflow_execs'):
         self.controller.loaded_workflow_execs = {}
         for e in self.controller.read_log().workflow_execs:
             # set workflow names
             e.db_name = controller.get_pipeline_name(e.parent_version)
             self.controller.loaded_workflow_execs[e] = e
     self.log = self.controller.loaded_workflow_execs
开发者ID:Nikea,项目名称:VisTrails,代码行数:9,代码来源:vis_log.py

示例4: paintEvent

 def paintEvent(self, event):
     """ paintEvent(event: QPaintEvent) -> None
     Fit pipeline to view on first paint
     
     """
     if not self._shown:
         self._shown = True
         self.scene().fitToView(self)
     QPipelineView.paintEvent(self, event)
开发者ID:cjh1,项目名称:VisTrails,代码行数:9,代码来源:pipeline_view_select.py

示例5: mouseMoveEvent

 def mouseMoveEvent(self, event):
     """ mousePressEvent(event: QMouseEvent) -> None
     Disallow left click and drag
     
     """
     buttons = self.translateButton(event)
     if buttons == QtCore.Qt.LeftButton:
         event.accept()
     else:
         QPipelineView.mouseMoveEvent(self, event)
开发者ID:cjh1,项目名称:VisTrails,代码行数:10,代码来源:pipeline_view_select.py

示例6: mouseDoubleClickEvent

 def mouseDoubleClickEvent(self, event):
     """ mouseDoubleClickEvent(event: QMouseEvent) -> None
     Disallow left button double clicks
     
     """
     buttons = self.translateButton(event)
     if buttons == QtCore.Qt.LeftButton:
         event.accept()
     else:
         QPipelineView.mouseDoubleClickEvent(self, event)
开发者ID:cjh1,项目名称:VisTrails,代码行数:10,代码来源:pipeline_view_select.py

示例7: mouseReleaseEvent

 def mouseReleaseEvent(self, event):
     """ mouseReleaseEvent(event: QMouseEvent) -> None
     Update port highlighting
     
     """
     if event.button() == QtCore.Qt.LeftButton:
         port = self._clicked_port
         if port is not None:
             port.setSelected(port in self._selected_input_ports or
                              port in self._selected_output_ports)
         event.accept()
     else:
         QPipelineView.mouseReleaseEvent(self, event)
开发者ID:cjh1,项目名称:VisTrails,代码行数:13,代码来源:pipeline_view_select.py

示例8: paintEvent

 def paintEvent(self, event):
     """ paintEvent(event: QPaintEvent) -> None
     Paint an overlay annotation on spreadsheet cell modules
     
     """
     QPipelineView.paintEvent(self, event)
     # super(QAnnotatedPipelineView, self).paintEvent(event)
     if self.scene():
         painter = QtGui.QPainter(self.viewport())
         for mId, annotatedId in \
                 self.inspector.annotated_modules.iteritems():
             if mId not in self.scene().modules:
                 # faulty annotated_modules entry
                 continue
             item = self.scene().modules[mId]
             br = item.sceneBoundingRect()
             rect = QtCore.QRect(self.mapFromScene(br.topLeft()),
                                 self.mapFromScene(br.bottomRight()))
             QAnnotatedPipelineView.drawId(painter, rect, annotatedId)
         painter.end()
开发者ID:alexmavr,项目名称:VisTrails,代码行数:20,代码来源:pe_pipeline.py

示例9: __init__

 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)
开发者ID:Nikea,项目名称:VisTrails,代码行数:40,代码来源:pipeline_view_select.py

示例10: __init__

 def __init__(self, parent=None):
     QPipelineView.__init__(self, parent)
     self.setBackgroundBrush(CurrentTheme.QUERY_RESULT_BACKGROUND_BRUSH)
     self.scene().set_read_only_mode(True)
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:4,代码来源:query_view.py


注:本文中的vistrails.gui.pipeline_view.QPipelineView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。