eric7/E5Gui/E5TabWidget.py

branch
eric7
changeset 8318
962bce857696
parent 8312
800c432b34c8
child 8340
439b5c4c9115
--- a/eric7/E5Gui/E5TabWidget.py	Sun May 16 11:43:59 2021 +0200
+++ b/eric7/E5Gui/E5TabWidget.py	Sun May 16 20:07:24 2021 +0200
@@ -9,9 +9,9 @@
 
 import contextlib
 
-from PyQt5.QtCore import pyqtSignal, Qt, QPoint, QMimeData
-from PyQt5.QtGui import QDrag
-from PyQt5.QtWidgets import QTabWidget, QTabBar, QApplication, QStyle
+from PyQt6.QtCore import pyqtSignal, Qt, QPoint, QMimeData
+from PyQt6.QtGui import QDrag
+from PyQt6.QtWidgets import QTabWidget, QTabBar, QApplication, QStyle
 
 from E5Gui.E5AnimatedLabel import E5AnimatedLabel
 
@@ -73,7 +73,7 @@
         @param event reference to the mouse press event (QMouseEvent)
         """
         if event.button() == Qt.MouseButton.LeftButton:
-            self.__dragStartPos = QPoint(event.pos())
+            self.__dragStartPos = QPoint(event.position().toPoint())
         E5WheelTabBar.mousePressEvent(self, event)
     
     def mouseMoveEvent(self, event):
@@ -84,12 +84,12 @@
         """
         if (
             event.buttons() == Qt.MouseButtons(Qt.MouseButton.LeftButton) and
-            (event.pos() - self.__dragStartPos).manhattanLength() >
+            (event.position().toPoint() - self.__dragStartPos).manhattanLength() >
             QApplication.startDragDistance()
         ):
             drag = QDrag(self)
             mimeData = QMimeData()
-            index = self.tabAt(event.pos())
+            index = self.tabAt(event.position().toPoint())
             mimeData.setText(self.tabText(index))
             mimeData.setData("action", b"tab-reordering")
             mimeData.setData("tabbar-id", str(id(self)).encode("utf-8"))
@@ -121,7 +121,7 @@
         @param event reference to the drop event (QDropEvent)
         """
         fromIndex = self.tabAt(self.__dragStartPos)
-        toIndex = self.tabAt(event.pos())
+        toIndex = self.tabAt(event.position().toPoint())
         if fromIndex != toIndex:
             self.tabMoveRequested.emit(fromIndex, toIndex)
             event.acceptProposedAction()

eric ide

mercurial