本文整理匯總了Python中PyQt4.QtGui.QTabBar.mouseMoveEvent方法的典型用法代碼示例。如果您正苦於以下問題:Python QTabBar.mouseMoveEvent方法的具體用法?Python QTabBar.mouseMoveEvent怎麽用?Python QTabBar.mouseMoveEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QTabBar
的用法示例。
在下文中一共展示了QTabBar.mouseMoveEvent方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: mouseMoveEvent
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import mouseMoveEvent [as 別名]
def mouseMoveEvent(self,event):
index = 0
while(index < self.count()):
if self.tabRect(index).contains(event.pos(),True):
self.hoveredTab = index
self.repaint()
break
index += 1
QTabBar.mouseMoveEvent(self,event)
示例2: mouseMoveEvent
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import mouseMoveEvent [as 別名]
def mouseMoveEvent(self, event):
"""Override Qt method"""
if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \
(event.pos() - self.__drag_start_pos).manhattanLength() > \
QApplication.startDragDistance():
drag = QDrag(self)
mimeData = QMimeData()
mimeData.setData("parent-id", QByteArray.number(id(self.ancestor)))
mimeData.setData("tabwidget-id",
QByteArray.number(id(self.parentWidget())))
mimeData.setData("tabbar-id", QByteArray.number(id(self)))
mimeData.setData("source-index",
QByteArray.number(self.tabAt(self.__drag_start_pos)))
drag.setMimeData(mimeData)
drag.exec_()
QTabBar.mouseMoveEvent(self, event)
示例3: mouseMoveEvent
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import mouseMoveEvent [as 別名]
def mouseMoveEvent(self, event):
"""Override Qt method"""
if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \
(event.pos() - self.__drag_start_pos).manhattanLength() > \
QApplication.startDragDistance():
drag = QDrag(self)
mimeData = QMimeData()
# Converting id's to long to avoid an OverflowError with PySide
ancestor_id = long(id(self.ancestor))
parent_widget_id = long(id(self.parentWidget()))
self_id = long(id(self))
mimeData.setData("parent-id", QByteArray.number(ancestor_id))
mimeData.setData("tabwidget-id",
QByteArray.number(parent_widget_id))
mimeData.setData("tabbar-id", QByteArray.number(self_id))
mimeData.setData("source-index",
QByteArray.number(self.tabAt(self.__drag_start_pos)))
drag.setMimeData(mimeData)
drag.exec_()
QTabBar.mouseMoveEvent(self, event)