79 """ |
79 """ |
80 Protected method to handle mouse move events. |
80 Protected method to handle mouse move events. |
81 |
81 |
82 @param event reference to the mouse move event (QMouseEvent) |
82 @param event reference to the mouse move event (QMouseEvent) |
83 """ |
83 """ |
84 if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \ |
84 if ( |
85 (event.pos() - self.__dragStartPos).manhattanLength() > \ |
85 event.buttons() == Qt.MouseButtons(Qt.LeftButton) and |
86 QApplication.startDragDistance(): |
86 (event.pos() - self.__dragStartPos).manhattanLength() > |
|
87 QApplication.startDragDistance() |
|
88 ): |
87 drag = QDrag(self) |
89 drag = QDrag(self) |
88 mimeData = QMimeData() |
90 mimeData = QMimeData() |
89 index = self.tabAt(event.pos()) |
91 index = self.tabAt(event.pos()) |
90 mimeData.setText(self.tabText(index)) |
92 mimeData.setText(self.tabText(index)) |
91 mimeData.setData("action", b"tab-reordering") |
93 mimeData.setData("action", b"tab-reordering") |
100 |
102 |
101 @param event reference to the drag enter event (QDragEnterEvent) |
103 @param event reference to the drag enter event (QDragEnterEvent) |
102 """ |
104 """ |
103 mimeData = event.mimeData() |
105 mimeData = event.mimeData() |
104 formats = mimeData.formats() |
106 formats = mimeData.formats() |
105 if "action" in formats and \ |
107 if ( |
106 mimeData.data("action") == b"tab-reordering" and \ |
108 "action" in formats and |
107 "tabbar-id" in formats and \ |
109 mimeData.data("action") == b"tab-reordering" and |
108 int(mimeData.data("tabbar-id")) == id(self): |
110 "tabbar-id" in formats and |
|
111 int(mimeData.data("tabbar-id")) == id(self) |
|
112 ): |
109 event.acceptProposedAction() |
113 event.acceptProposedAction() |
110 E5WheelTabBar.dragEnterEvent(self, event) |
114 E5WheelTabBar.dragEnterEvent(self, event) |
111 |
115 |
112 def dropEvent(self, event): |
116 def dropEvent(self, event): |
113 """ |
117 """ |