本文整理汇总了Python中PyQt4.QtCore.QMimeData.data方法的典型用法代码示例。如果您正苦于以下问题:Python QMimeData.data方法的具体用法?Python QMimeData.data怎么用?Python QMimeData.data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QMimeData
的用法示例。
在下文中一共展示了QMimeData.data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start_drag
# 需要导入模块: from PyQt4.QtCore import QMimeData [as 别名]
# 或者: from PyQt4.QtCore.QMimeData import data [as 别名]
def start_drag(self, info_id):
_logger.info( "started dragging" )
mimeData = QMimeData()
mimeData.data =("/" + info_id.partition("/")[2].partition("/")[0], moose.element(info_id))
mimeData.setText(info_id)
drag = QDrag(self)
drag.setMimeData(mimeData)
pixmap = QPixmap("")
drag.setPixmap(pixmap)
# drag.setHotSpot(e.pos() - self.rect().topLeft())
dropAction = drag.start(QtCore.Qt.MoveAction)
print((" => ", dropAction))
self.select_info.set_event_type(0)
self._timer.start(0)
return
示例2: start_drag
# 需要导入模块: from PyQt4.QtCore import QMimeData [as 别名]
# 或者: from PyQt4.QtCore.QMimeData import data [as 别名]
def start_drag(self, info_id):
# pixmap = QPixmap()
# painter = QPainter( pixmap )
# painter.setFont( QFont("Arial") );
# painter.drawText( QPoint(100, 100), info_id );
mimeData = QMimeData()
mimeData.data =("/" + info_id.partition("/")[2].partition("/")[0], moose.element(info_id))
mimeData.setText(info_id)
drag = QDrag(self)
drag.setMimeData(mimeData)
pixmap = QPixmap("")
drag.setPixmap(pixmap)
# drag.setHotSpot(e.pos() - self.rect().topLeft())
dropAction = drag.start(QtCore.Qt.MoveAction)
print(" => ", dropAction)
self.select_info.set_event_type(0)
self._timer.start(0)
return