本文整理匯總了Python中PyQt4.QtGui.QTabBar.dropEvent方法的典型用法代碼示例。如果您正苦於以下問題:Python QTabBar.dropEvent方法的具體用法?Python QTabBar.dropEvent怎麽用?Python QTabBar.dropEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QTabBar
的用法示例。
在下文中一共展示了QTabBar.dropEvent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: dropEvent
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import dropEvent [as 別名]
def dropEvent(self, event):
"""Override Qt method"""
mimeData = event.mimeData()
index_from = mimeData.data("source-index").toInt()[0]
index_to = self.tabAt(event.pos())
if mimeData.data("tabbar-id").toLong()[0] != id(self):
tabwidget_from = mimeData.data("tabwidget-id").toLong()[0]
self.emit(SIGNAL("move_tab(long,int,int)"),
tabwidget_from, index_from, index_to)
event.acceptProposedAction()
elif index_from != index_to:
self.emit(SIGNAL("move_tab(int,int)"), index_from, index_to)
event.acceptProposedAction()
QTabBar.dropEvent(self, event)
示例2: dropEvent
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import dropEvent [as 別名]
def dropEvent(self, event):
"""Override Qt method"""
mimeData = event.mimeData()
index_from = mimeData.data("source-index").toInt()[0]
index_to = self.tabAt(event.pos())
if index_to == -1:
index_to = self.count()
if mimeData.data("tabbar-id").toLong()[0] != id(self):
tabwidget_from = str(mimeData.data("tabwidget-id").toLong()[0])
# We pass self object ID as a QString, because otherwise it would
# depend on the platform: long for 64bit, int for 32bit. Replacing
# by long all the time is not working on some 32bit platforms
# (see Issue 1094, Issue 1098)
self.emit(SIGNAL("move_tab(QString,int,int)"),
tabwidget_from, index_from, index_to)
event.acceptProposedAction()
elif index_from != index_to:
self.emit(SIGNAL("move_tab(int,int)"), index_from, index_to)
event.acceptProposedAction()
QTabBar.dropEvent(self, event)