本文整理汇总了Python中PySide.QtGui.QPixmap.grabWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QPixmap.grabWidget方法的具体用法?Python QPixmap.grabWidget怎么用?Python QPixmap.grabWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QPixmap
的用法示例。
在下文中一共展示了QPixmap.grabWidget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mousePressEvent
# 需要导入模块: from PySide.QtGui import QPixmap [as 别名]
# 或者: from PySide.QtGui.QPixmap import grabWidget [as 别名]
def mousePressEvent( self, event ):
# handle an internal move
# start a drag event
if event.button() == Qt.LeftButton and self.dragDropRect().contains(event.pos()):
# create the pixmap
pixmap = QPixmap.grabWidget(self, self.rect())
# create the mimedata
mimeData = QMimeData()
mimeData.setText('ItemTitle::%s' % (self.title()))
# create the drag
drag = QDrag(self)
drag.setMimeData(mimeData)
drag.setPixmap(pixmap)
drag.setHotSpot(event.pos())
if not drag.exec_():
self._accordianWidget.emitItemDragFailed(self)
event.accept()
# determine if the expand/collapse should occur
elif event.button() == Qt.LeftButton and self.expandCollapseRect().contains(event.pos()):
self._clicked = True
event.accept()
else:
event.ignore()
示例2: on_shot_button_clicked
# 需要导入模块: from PySide.QtGui import QPixmap [as 别名]
# 或者: from PySide.QtGui.QPixmap import grabWidget [as 别名]
def on_shot_button_clicked(self):
self.image_label.setPixmap(QPixmap.grabWidget(self))
示例3: do_copy
# 需要导入模块: from PySide.QtGui import QPixmap [as 别名]
# 或者: from PySide.QtGui.QPixmap import grabWidget [as 别名]
def do_copy(self): # Need this in case there's no navigation toolbar.
pixmap = QPixmap.grabWidget(self.canvas)
QApplication.clipboard().setPixmap(pixmap)
示例4: _get_image
# 需要导入模块: from PySide.QtGui import QPixmap [as 别名]
# 或者: from PySide.QtGui.QPixmap import grabWidget [as 别名]
def _get_image ( self ):
return ImageResource(
bitmap = QPixmap.grabWidget( self.control, 0, 0 )
)