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


Python QAnnotatedPipelineView.setReadOnlyMode方法代码示例

本文整理汇总了Python中vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView.setReadOnlyMode方法的典型用法代码示例。如果您正苦于以下问题:Python QAnnotatedPipelineView.setReadOnlyMode方法的具体用法?Python QAnnotatedPipelineView.setReadOnlyMode怎么用?Python QAnnotatedPipelineView.setReadOnlyMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView的用法示例。


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

示例1: QParameterView

# 需要导入模块: from vistrails.gui.paramexplore.pe_pipeline import QAnnotatedPipelineView [as 别名]
# 或者: from vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView import setReadOnlyMode [as 别名]
class QParameterView(QtGui.QWidget, QVistrailsPaletteInterface):
    """
    QParameterView contains the parameter exploration properties and the
    parameter palette
    
    """
    def __init__(self, controller=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.set_title('Pipeline Methods')
        
        self.controller = None
        vLayout = QtGui.QVBoxLayout()
        vLayout.setMargin(0)
        vLayout.setSpacing(5)
        self.setLayout(vLayout)

        self.toggleUnsetParameters = QtGui.QCheckBox('Show Unset Parameters')
        vLayout.addWidget(self.toggleUnsetParameters, 0, QtCore.Qt.AlignRight)

        self.parameterWidget = QParameterWidget()
        vLayout.addWidget(self.parameterWidget)
        self.treeWidget = self.parameterWidget.treeWidget

        self.pipeline_view = QAnnotatedPipelineView()
        self.pipeline_view.setReadOnlyMode(True)
        vLayout.addWidget(self.pipeline_view)

        vLayout.setStretch(0,0)
        vLayout.setStretch(1,1)
        vLayout.setStretch(2,0)

        self.connect(self.toggleUnsetParameters, QtCore.SIGNAL("toggled(bool)"),
                     self.parameterWidget.treeWidget.toggleUnsetParameters)
        self.set_controller(controller)

    def set_controller(self, controller):
        if self.controller == controller:
            return
        self.controller = controller
        self.pipeline_view.set_controller(controller)
        if self.controller is not None:
            self.set_pipeline(controller.current_pipeline)
        else:
            self.set_pipeline(None)

    def set_pipeline(self, pipeline):
        if self.controller is None:
            return
        self.pipeline = pipeline
        self.parameterWidget.set_pipeline(pipeline, self.controller)
        if pipeline:
            self.pipeline_view.scene().setupScene(pipeline)
        else:
            self.pipeline_view.scene().clear()
        self.pipeline_view.updateAnnotatedIds(pipeline)
开发者ID:Nikea,项目名称:VisTrails,代码行数:57,代码来源:param_view.py

示例2: QAliasParameterView

# 需要导入模块: from vistrails.gui.paramexplore.pe_pipeline import QAnnotatedPipelineView [as 别名]
# 或者: from vistrails.gui.paramexplore.pe_pipeline.QAnnotatedPipelineView import setReadOnlyMode [as 别名]
class QAliasParameterView(QtGui.QWidget, QVistrailsPaletteInterface):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.set_title("Mashup Pipeline")
        layout = QtGui.QVBoxLayout()
        self.parameter_panel = QAliasParameterPanel()
        font = QtGui.QFont("Arial", 11, QtGui.QFont.Normal)
        font.setItalic(True)
        label = QtGui.QLabel("Double-click a parameter to change alias")
        label.setFont(font)
        param_group = QtGui.QGroupBox(self.parameter_panel.windowTitle())
        g_layout = QtGui.QVBoxLayout()
        g_layout.setMargin(0)
        g_layout.setSpacing(2)
        g_layout.addWidget(label)
        g_layout.addWidget(self.parameter_panel)
        param_group.setLayout(g_layout)
        layout.addWidget(param_group)

        self.pipeline_view = QAnnotatedPipelineView()
        self.pipeline_view.setReadOnlyMode(True)
        p_view_group = QtGui.QGroupBox(self.pipeline_view.windowTitle())
        g_layout = QtGui.QVBoxLayout()
        g_layout.setMargin(0)
        g_layout.setSpacing(0)
        g_layout.addWidget(self.pipeline_view)
        p_view_group.setLayout(g_layout)
        layout.addWidget(p_view_group)
        self.setLayout(layout)

        self.parameter_panel.treeWidget.aliasChanged.connect(self.aliasChanged)

    def updateMshpController(self, mshpController):
        from vistrails.gui.vistrails_window import _app

        self.mshpController = mshpController
        self.parameter_panel.set_pipeline(self.mshpController.vtPipeline)
        self.pipeline_view.set_controller(self.mshpController.vtController)
        self.mshpController.vtController.current_pipeline_view = self.pipeline_view
        self.pipeline_view.scene().current_pipeline = self.mshpController.vtPipeline
        self.mshpController.vtController.current_pipeline = self.mshpController.vtPipeline

        # print "**** should update mashup pipeline view "

        # self.pipeline_view.scene().setupScene(self.mshpController.vtPipeline)
        self.pipeline_view.scene().clear()
        self.pipeline_view.version_changed()
        self.pipeline_view.updateAnnotatedIds(self.mshpController.vtPipeline)
        # _app.notify('mashup_pipeline_view_set')

    def updateMshpVersion(self, version):
        # print "will update alias param view"
        self.parameter_panel.set_pipeline(self.mshpController.vtPipeline)
        self.pipeline_view.version_changed()

    def zoomToFit(self):
        if self.pipeline_view:
            self.pipeline_view.zoomToFit()

    def aliasChanged(self, param):
        from vistrails.gui.vistrails_window import _app

        _app.notify("alias_changed", param)
开发者ID:,项目名称:,代码行数:65,代码来源:


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