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


Python spreadsheet_cell.QCellWidget类代码示例

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


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

示例1: __init__

    def __init__(self, parent=None):
        QCellWidget.__init__(self, parent)
        
        centralLayout = QtGui.QVBoxLayout()
        self.setLayout(centralLayout)
        centralLayout.setMargin(0)
        centralLayout.setSpacing(0)
                
        self.view = vtk.vtkContextView()
        self.widget = QVTKRenderWindowInteractor(self, 
                                                 rw=self.view.GetRenderWindow(),
                                                 iren=self.view.GetInteractor()
                                                )

        self.chart = vtk.vtkChartParallelCoordinates()
        self.view.GetScene().AddItem(self.chart)

        self.layout().addWidget(self.widget)

        # Create a annotation link to access selection in parallel coordinates view
        self.annotationLink = vtk.vtkAnnotationLink()
        # If you don't set the FieldType explicitly it ends up as UNKNOWN (as of 21 Feb 2010)
        # See vtkSelectionNode doc for field and content type enum values
        self.annotationLink.GetCurrentSelection().GetNode(0).SetFieldType(1)     # Point
        self.annotationLink.GetCurrentSelection().GetNode(0).SetContentType(4)   # Indices
        # Connect the annotation link to the parallel coordinates representation
        self.chart.SetAnnotationLink(self.annotationLink)
        self.annotationLink.AddObserver("AnnotationChangedEvent", self.selectionCallback)
开发者ID:imclab,项目名称:vistrails,代码行数:28,代码来源:plots.py

示例2: __init__

 def __init__(self, parent=None):
     QCellWidget.__init__(self, parent)        
     self.window = None
     self.canvas =  None
     self.windowId = -1
     layout = QtGui.QVBoxLayout()
     self.setLayout(layout) 
开发者ID:imclab,项目名称:vistrails,代码行数:7,代码来源:cdat_cell.py

示例3: updateContents

    def updateContents(self, inputPorts):
        if self.view==None:
            self.view = pvsp.CreateRenderView()
            renWin = self.view.GetRenderWindow()
            self.SetRenderWindow(renWin)
            iren = renWin.GetInteractor()
            iren.SetNonInteractiveRenderDelay(0)
            iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())

        del self.view.Representations[:]

        # Fetch variables from the input port
        (location, representations) = inputPorts
        
        for rep in representations:
            rep.set_view(self.view)
            rep.execute()

        # Set view specific properties
        self.view.CenterAxesVisibility = 0
        self.view.Background = [0.5, 0.5, 0.5]

        self.view.ResetCamera()
        self.view.StillRender()

        QCellWidget.updateContents(self, inputPorts)
开发者ID:imclab,项目名称:vistrails,代码行数:26,代码来源:pvgenericcell.py

示例4: updateContents

    def updateContents(self, inputPorts):
        """ updateContents(inputPorts: tuple)
        Updates the cell contents with new vtkRenderer
        
        """
        (renderView, ) = inputPorts
        renWin = renderView.vtkInstance.GetRenderWindow()
        renWin.DoubleBufferOn()
        self.SetRenderWindow(renWin)
        renderView.vtkInstance.ResetCamera()
        self.addObserversToInteractorStyle()
        
#        renWin = self.GetRenderWindow()
#        renderers = [renderView.vtkInstance.GetRenderer()]
#        iren = renWin.GetInteractor()
        # Update interactor style
#         self.removeObserversFromInteractorStyle()
#         if renderView==None:
#             if iStyle==None:
#                 iStyleInstance = vtk.vtkInteractorStyleTrackballCamera()
#             else:
#                 iStyleInstance = iStyle.vtkInstance
#             iren.SetInteractorStyle(iStyleInstance)
#         self.addObserversToInteractorStyle()
        # Capture window into history for playback
        # Call this at the end to capture the image after rendering
        QCellWidget.updateContents(self, inputPorts)
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:27,代码来源:vtkviewcell.py

示例5: __init__

 def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
     QCellWidget.__init__(self,parent,f)
     self.layout = QVBoxLayout(self)
     self.view = None
     self.location = None
     self.cdms_var = None
     self.params = None
开发者ID:imclab,项目名称:vistrails,代码行数:7,代码来源:visitcell.py

示例6: deleteLater

 def deleteLater(self):
     """ deleteLater() -> None        
     Make sure to free render window resource when
     deallocating. Overriding PyQt deleteLater to free up
     resources
     """
     self.canvas = None
     QCellWidget.deleteLater(self)    
开发者ID:cjh1,项目名称:VisTrails,代码行数:8,代码来源:cdat_cell.py

示例7: updateContents

    def updateContents(self, inputPorts):
        """ updateContents(inputPorts: tuple)
        Updates the cell contents with new vtkRenderer
        
        """
        renWin = self.GetRenderWindow()
        for iHandler in self.iHandlers:
            if iHandler.observer:
                iHandler.observer.vtkInstance.SetInteractor(None)
            iHandler.clear()

        # Remove old renderers first
        oldRenderers = self.getRendererList()
        for renderer in oldRenderers:
            renWin.RemoveRenderer(renderer)
            renderer.SetRenderWindow(None)
        del oldRenderers

        (renderers, renderView, self.iHandlers, iStyle, picker) = inputPorts
        if renderView:
            renderView.vtkInstance.SetupRenderWindow(renWin)
            renderers = [renderView.vtkInstance.GetRenderer()]
        self.renderer_maps = {}
        for renderer in renderers:
            if renderView == None:
                vtkInstance = renderer.vtkInstance
                renWin.AddRenderer(vtkInstance)
                self.renderer_maps[vtkInstance] = renderer.moduleInfo["moduleId"]
            else:
                vtkInstance = renderer
            if hasattr(vtkInstance, "IsActiveCameraCreated"):
                if not vtkInstance.IsActiveCameraCreated():
                    vtkInstance.ResetCamera()
                else:
                    vtkInstance.ResetCameraClippingRange()

        iren = renWin.GetInteractor()
        if picker:
            iren.SetPicker(picker.vtkInstance)

        # Update interactor style
        self.removeObserversFromInteractorStyle()
        if renderView == None:
            if iStyle == None:
                iStyleInstance = vtk.vtkInteractorStyleTrackballCamera()
            else:
                iStyleInstance = iStyle.vtkInstance
            iren.SetInteractorStyle(iStyleInstance)
        self.addObserversToInteractorStyle()

        for iHandler in self.iHandlers:
            if iHandler.observer:
                iHandler.observer.vtkInstance.SetInteractor(iren)
        renWin.Render()

        # Capture window into history for playback
        # Call this at the end to capture the image after rendering
        QCellWidget.updateContents(self, inputPorts)
开发者ID:VisTrails,项目名称:vistrails-contrib-legacy,代码行数:58,代码来源:vtkcell.py

示例8: deleteLater

 def deleteLater(self):
     global viswinmapper
     #print "deleting" 
     if self.view is not None:
         self.view.setParent(None)
         windowKey = self.getKey()
         availWindows.append((self.view,viswinmapper[windowKey]))
         del viswinmapper[windowKey]
     QCellWidget.deleteLater(self)
开发者ID:imclab,项目名称:vistrails,代码行数:9,代码来源:visitcell.py

示例9: __init__

 def __init__(self, parent=None):
     """ QGISCellWidget(parent: QWidget) -> QGISCellWidget
     Initialize the widget with its central layout
     
     """
     QCellWidget.__init__(self, parent)
     centralLayout = QtGui.QVBoxLayout()
     self.setLayout(centralLayout)
     centralLayout.setMargin(0)
     centralLayout.setSpacing(0)
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:10,代码来源:init.py

示例10: updateContents

 def updateContents(self, inputPorts):
     (self.coord, matrix) = inputPorts 
     if self.coord is not None: self.coord.register(self)
 
     self.createTable(matrix)
     self.widget.Initialize()
     
     # Capture window into history for playback
     # Call this at the end to capture the image after rendering
     QCellWidget.updateContents(self, inputPorts)
开发者ID:imclab,项目名称:vistrails,代码行数:10,代码来源:plots.py

示例11: __init__

    def __init__(self, parent=None):
        """ SVGCellWidget(parent: QWidget) -> SVGCellWidget
        Create a SVGCellWidget without any toolbar
        """
        QCellWidget.__init__(self, parent)        
        self.setLayout(QtGui.QVBoxLayout(self))

        self.svgWidget = QtSvg.QSvgWidget()
        self.layout().addWidget(self.svgWidget)
        
        self.controlBarType = None
        self.fileSrc = None
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:12,代码来源:svg.py

示例12: dumpToFile

 def dumpToFile(self, filename):
     """ dumpToFile(filename) -> None
     It will generate a screenshot of the cell contents and dump to filename
     It will also create a copy of the original text file used with
     filename's base name and the original extension.
     """
     if self.fileSrc is not None:
         (_, s_ext) = os.path.splitext(self.fileSrc)
         (f_root, f_ext) = os.path.splitext(filename)
         ori_filename = f_root + s_ext
         shutil.copyfile(self.fileSrc, ori_filename)
     QCellWidget.dumpToFile(self, filename)
开发者ID:ict4eo,项目名称:eo4vistrails,代码行数:12,代码来源:excelcell.py

示例13: __init__

    def __init__(self, parent=None):
        """ ExcelCellWidget(parent: QWidget) -> ExcelCellWidget
        Create a rich text cell without a toolbar

        """
        QCellWidget.__init__(self, parent)
        self.setLayout(QtGui.QVBoxLayout(self))
        self.browser = QtGui.QTextBrowser()
        self.layout().addWidget(self.browser)
        self.browser.setMouseTracking(True)
        self.browser.controlBarType = None
        self.fileSrc = None
开发者ID:ict4eo,项目名称:eo4vistrails,代码行数:12,代码来源:excelcell.py

示例14: deleteLater

 def deleteLater(self):
     """ deleteLater() -> None        
     Make sure to free render window resource when
     deallocating. Overriding PyQt deleteLater to free up
     resources
     
     """
     self.renderer_maps = {}
     for ren in self.getRendererList():
         self.mRenWin.RemoveRenderer(ren)
     self.removeObserversFromInteractorStyle()
     self.SetRenderWindow(None)
     QCellWidget.deleteLater(self)
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:13,代码来源:vtkviewcell.py

示例15: __init__

 def __init__(self, parent=None):
     """ IECellWidget(parent: QWidget) -> IECellWidget
     Create a ActiveX Container pointing to the IE Cell
     
     """
     QCellWidget.__init__(self, parent)
     vbox = QtGui.QVBoxLayout(self)
     vbox.setMargin(0)
     self.setLayout(vbox)
     self.browser = QAxContainer.QAxWidget(self)
     self.browser.setFocusPolicy(QtCore.Qt.StrongFocus)
     self.browser.setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}")
     vbox.addWidget(self.browser)
     self.urlSrc = None
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:14,代码来源:iecell.py


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