本文整理汇总了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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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
示例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)
示例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