本文整理汇总了Python中vistrails.packages.spreadsheet.spreadsheet_cell.QCellWidget类的典型用法代码示例。如果您正苦于以下问题:Python QCellWidget类的具体用法?Python QCellWidget怎么用?Python QCellWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QCellWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: 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)
示例2: updateContents
def updateContents(self, input_ports):
(data,keys) = input_ports
layout = QtGui.QHBoxLayout()
widg = Stack1DMainWindow(data_list=data, key_list=keys)
layout.addWidget(widg)
self.setLayout(layout)
QCellWidget.updateContents(self, input_ports)
示例3: deleteLater
def deleteLater(self):
""" deleteLater() -> None
Overriding PyQt deleteLater to free up resources
"""
# Destroy the old one if possible
if self.figure is not None:
pylab.close(self.figure)
QCellWidget.deleteLater(self)
示例4: __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)
示例5: __init__
def __init__(self, parent=None):
""" WebViewCellWidget(parent: QWidget) -> WebViewCellWidget
Create a rich text cell without a toolbar
"""
QCellWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout(self))
self.browser = QtWebKit.QWebView()
self.layout().addWidget(self.browser)
self.browser.setMouseTracking(True)
self.urlSrc = None
示例6: 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 basename and the original extension.
"""
if self.html is not None:
basename, ext = os.path.splitext(filename)
with open(basename + '.html', 'wb') as fp:
fp.write(self.html.encode('utf-8'))
QCellWidget.dumpToFile(self,filename)
示例7: __init__
def __init__(self, parent=None):
""" RichTextCellWidget(parent: QWidget) -> RichTextCellWidget
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.html = None
示例8: __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
示例9: __init__
def __init__(self, parent=None):
QCellWidget.__init__(self, parent)
layout = QtGui.QVBoxLayout()
self.table = QtGui.QTableWidget()
scrollarea = QtGui.QScrollArea(self)
scrollarea.setWidgetResizable(True)
scrollarea.setWidget(self.table)
layout.addWidget(scrollarea)
self.setLayout(layout)
示例10: 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)
示例11: __init__
def __init__(self, parent=None):
""" WebViewCellWidget(parent: QWidget) -> WebViewCellWidget
Create a rich text cell without a toolbar
"""
QCellWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout(self))
QtWebKit.QWebSettings.globalSettings().setAttribute(
QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
self.browser = QtWebKit.QWebView()
self.layout().addWidget(self.browser)
self.browser.setMouseTracking(True)
self.urlSrc = None
示例12: __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
示例13: __init__
def __init__(self, parent=None):
""" MplFigureCellWidget(parent: QWidget) -> MplFigureCellWidget
Initialize the widget with its central layout
"""
QCellWidget.__init__(self, parent)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
centralLayout = QtGui.QVBoxLayout()
self.setLayout(centralLayout)
centralLayout.setMargin(0)
centralLayout.setSpacing(0)
self.canvas = None
self.figure = None
self.figManager = None
self.toolBarType = MplFigureCellToolBar
self.mplToolbar = None
示例14: __init__
def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
""" QVTKViewWidget(parent: QWidget, f: WindowFlags) -> QVTKViewWidget
Initialize QVTKViewWidget with a toolbar with its own device
context
"""
QCellWidget.__init__(self, parent, f | QtCore.Qt.MSWindowsOwnDC)
self.interacting = None
self.mRenWin = None
self.setAttribute(QtCore.Qt.WA_OpaquePaintEvent)
self.setAttribute(QtCore.Qt.WA_PaintOnScreen)
self.setMouseTracking(True)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
self.toolBarType = QVTKViewWidgetToolBar
self.setAnimationEnabled(True)
示例15: updateContents
def updateContents(self, inputPorts):
""" updateContents(inputPorts: tuple) -> None
Update the widget contents based on the input data
"""
(fileValue, ) = inputPorts
if fileValue:
img = QtGui.QImage()
if img.load(fileValue.name):
self.originalPix = QtGui.QPixmap.fromImage(img)
self.label.setPixmap(self.originalPix.scaled(self.label.size(),
QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation))
else:
self.label.setText("Invalid image file!")
QCellWidget.updateContents(self, inputPorts)