本文整理汇总了Python中vistrails.packages.spreadsheet.spreadsheet_cell.QCellWidget类的典型用法代码示例。如果您正苦于以下问题:Python QCellWidget类的具体用法?Python QCellWidget怎么用?Python QCellWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QCellWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:pombredanne,项目名称:VisTrails,代码行数:27,代码来源:vtkviewcell.py
示例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)
开发者ID:Nikea,项目名称:VTTools,代码行数:7,代码来源:vis.py
示例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)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:10,代码来源:figure_cell.py
示例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)
开发者ID:Nikea,项目名称:VisTrails,代码行数:10,代码来源:init.py
示例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
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:11,代码来源:webview.py
示例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)
开发者ID:pombredanne,项目名称:VisTrails,代码行数:11,代码来源:richtext.py
示例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
开发者ID:hjanime,项目名称:VisTrails,代码行数:12,代码来源:richtext.py
示例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
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:12,代码来源:svg.py
示例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)
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:13,代码来源:viewer.py
示例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)
开发者ID:pombredanne,项目名称:VisTrails,代码行数:13,代码来源:vtkviewcell.py
示例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
开发者ID:Nikea,项目名称:VisTrails,代码行数:13,代码来源:webview.py
示例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
开发者ID:cjh1,项目名称:VisTrails,代码行数:14,代码来源:iecell.py
示例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
开发者ID:tacaswell,项目名称:VisTrails,代码行数:16,代码来源:figure_cell.py
示例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)
开发者ID:pombredanne,项目名称:VisTrails,代码行数:17,代码来源:vtkviewcell.py
示例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)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:17,代码来源:imageviewer.py
示例16: 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:
if isinstance(self.html, bytes):
fp.write(self.html)
else:
codec = QtCore.QTextCodec.codecForHtml(
self.html.encode('utf-8'),
QtCore.QTextCodec.codecForName('UTF-8'))
fp.write(codec.fromUnicode(self.html))
QCellWidget.dumpToFile(self,filename)
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:17,代码来源:richtext.py
示例17: paintEngine
def paintEngine(self):
""" paintEngine() -> QPaintEngine
On Windows, this has to return None to fully disable
double-buffer (we let vtkRenderWindow handle this instead).
"""
if system.systemType in ['Windows', 'Microsoft']:
return None
else:
return QCellWidget.paintEngine(self)
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:10,代码来源:vtkcell.py
示例18: __init__
def __init__(self, parent=None):
""" ImageViewerCellWidget(parent: QWidget) -> ImageViewerCellWidget
Initialize the widget with its toolbar type and aligment
"""
QCellWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout(self))
self.setAnimationEnabled(True)
self.label = QtGui.QLabel()
self.layout().addWidget(self.label)
self.label.setAutoFillBackground(True)
self.label.palette().setColor(QtGui.QPalette.Window, QtCore.Qt.white)
self.label.setMouseTracking(False)
self.label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
self.label.setScaledContents(False)
self.toolBarType = ImageViewerToolBar
self.originalPix = None
self.setMinimumSize(1, 1)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:20,代码来源:imageviewer.py
示例19: 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:
# self.getFigManager().window.deleteLater()
print "pylab:", pylab
print "self.figure:", self.figure
pylab.close(self.figure)
# if self.figManager:
# try:
# pylab.close(self.figManager.canvas.figure)
# # There is a bug in Matplotlib backend_qt4. It is a
# # wrong command for Qt4. Just ignore it and continue
# # to destroy the widget
# except:
# pass
# self.figManager.window.deleteLater()
QCellWidget.deleteLater(self)
开发者ID:cjh1,项目名称:VisTrails,代码行数:24,代码来源:figure_cell.py
示例20: updateContents
def updateContents(self, inputPorts, cameralist = None):
""" 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 = {}
self.usecameras = False
if cameralist != None and len(cameralist) == len(renderers):
self.usecameras = True
j = 0
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 self.usecameras:
vtkInstance.SetActiveCamera(cameralist[j])
j = j + 1
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:lumig242,项目名称:VisTrailsRecommendation,代码行数:65,代码来源:vtkcell.py
注:本文中的vistrails.packages.spreadsheet.spreadsheet_cell.QCellWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论