--- a/eric7/E5Gui/E5ModelToolBar.py Sun May 16 11:43:59 2021 +0200 +++ b/eric7/E5Gui/E5ModelToolBar.py Sun May 16 20:07:24 2021 +0200 @@ -7,9 +7,9 @@ Module implementing a tool bar populated from a QAbstractItemModel. """ -from PyQt5.QtCore import pyqtSignal, Qt, QModelIndex, QPoint, QEvent -from PyQt5.QtGui import QDrag, QIcon -from PyQt5.QtWidgets import QApplication, QToolBar, QToolButton +from PyQt6.QtCore import pyqtSignal, Qt, QModelIndex, QPoint, QEvent +from PyQt6.QtGui import QDrag, QIcon +from PyQt6.QtWidgets import QApplication, QToolBar, QToolButton class E5ModelToolBar(QToolBar): @@ -126,7 +126,7 @@ menu = self._createMenu() menu.setModel(self.__model) menu.setRootIndex(idx) - act.setMenu(menu) + button.setMenu(menu) button.setPopupMode( QToolButton.ToolButtonPopupMode.InstantPopup) button.setToolButtonStyle( @@ -205,7 +205,7 @@ @exception RuntimeError raised to indicate an invalid model index """ if self.__model is not None: - act = self.actionAt(evt.pos()) + act = self.actionAt(evt.position().toPoint()) parentIndex = self.__root if act is None: row = self.__model.rowCount(self.__root) @@ -241,7 +241,7 @@ super().mouseMoveEvent(evt) return - manhattanLength = (evt.pos() - + manhattanLength = (evt.position().toPoint() - self.__dragStartPosition).manhattanLength() if manhattanLength <= QApplication.startDragDistance(): super().mouseMoveEvent(evt)