.pos() --> .position().toPoint() & ver.

This commit is contained in:
Dpeta 2022-07-08 10:54:22 +02:00
parent cfe4589a64
commit 39aaa1a49f
7 changed files with 21 additions and 20 deletions

View file

@ -1,6 +1,11 @@
# Changelog
(This document uses YYYY-MM-DD)
## [v2.4.2] - 2022-07-08
### Fixed
- Error when manually moving group.
## [v2.4.1] - 2022-07-05
### Added

View file

@ -448,7 +448,7 @@ class ConsoleText(QtWidgets.QTextEdit):
def mousePressEvent(self, event):
if event.button() == QtCore.Qt.MouseButton.LeftButton:
url = self.anchorAt(event.pos())
url = self.anchorAt(event.position().toPoint())
if url != "":
# Skip memo/handle recognition
# NOTE: Ctrl+Click copies the URL. Maybe it should select it?
@ -463,7 +463,7 @@ class ConsoleText(QtWidgets.QTextEdit):
def mouseMoveEvent(self, event):
# Change our cursor when we roll over links (anchors).
super(ConsoleText, self).mouseMoveEvent(event)
if self.anchorAt(event.pos()):
if self.anchorAt(event.position().toPoint()):
if self.viewport().cursor().shape != QtCore.Qt.CursorShape.PointingHandCursor:
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor))
else:

View file

@ -153,7 +153,7 @@ class PesterTabWindow(QtWidgets.QFrame):
def contextMenuEvent(self, event):
#~if event.reason() == QtGui.QContextMenuEvent.Reason.Mouse:
tabi = self.tabs.tabAt(event.pos())
tabi = self.tabs.tabAt(event.position().toPoint())
if tabi < 0:
tabi = self.tabs.currentIndex()
for h, i in list(self.tabIndices.items()):
@ -501,7 +501,7 @@ class PesterText(QtWidgets.QTextEdit):
def mousePressEvent(self, event):
if event.button() == QtCore.Qt.MouseButton.LeftButton:
url = self.anchorAt(event.pos())
url = self.anchorAt(event.position().toPoint())
if url != "":
if url[0] == "#" and url != "#pesterchum":
self.parent().mainwindow.showMemos(url[1:])
@ -516,7 +516,7 @@ class PesterText(QtWidgets.QTextEdit):
QtWidgets.QTextEdit.mousePressEvent(self, event)
def mouseMoveEvent(self, event):
QtWidgets.QTextEdit.mouseMoveEvent(self, event)
if self.anchorAt(event.pos()):
if self.anchorAt(event.position().toPoint()):
if self.viewport().cursor().shape != QtCore.Qt.CursorShape.PointingHandCursor:
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor))
else:

View file

@ -45,7 +45,7 @@ class RightClickList(QtWidgets.QListWidget):
def contextMenuEvent(self, event):
#fuckin Qt <--- I feel that </3
if event.reason() == QtGui.QContextMenuEvent.Reason.Mouse:
listing = self.itemAt(event.pos())
listing = self.itemAt(event.position().toPoint())
self.setCurrentItem(listing)
optionsMenu = self.getOptionsMenu()
if optionsMenu:
@ -56,7 +56,7 @@ class RightClickList(QtWidgets.QListWidget):
class RightClickTree(QtWidgets.QTreeWidget):
def contextMenuEvent(self, event):
if event.reason() == QtGui.QContextMenuEvent.Reason.Mouse:
listing = self.itemAt(event.pos())
listing = self.itemAt(event.position().toPoint())
self.setCurrentItem(listing)
optionsMenu = self.getOptionsMenu()
if optionsMenu:

View file

@ -272,7 +272,7 @@ class PesterLogText(PesterText):
def focusInEvent(self, event):
QtWidgets.QTextEdit.focusInEvent(self, event)
def mousePressEvent(self, event):
url = self.anchorAt(event.pos())
url = self.anchorAt(event.position().toPoint())
if url != "":
if url[0] == "#" and url != "#pesterchum":
self.parent().parent.showMemos(url[1:])
@ -284,7 +284,7 @@ class PesterLogText(PesterText):
QtWidgets.QTextEdit.mousePressEvent(self, event)
def mouseMoveEvent(self, event):
QtWidgets.QTextEdit.mouseMoveEvent(self, event)
if self.anchorAt(event.pos()):
if self.anchorAt(event.position().toPoint()):
if self.viewport().cursor().shape != QtCore.Qt.CursorShape.PointingHandCursor:
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor))
else:

View file

@ -518,14 +518,14 @@ class chumArea(RightClickTree):
if thisitem.rfind(" (") != -1:
thisitem = thisitem[0:thisitem.rfind(" (")]
if thisitem == "Chums" or thisitem in self.groups:
droppos = self.itemAt(event.pos())
droppos = self.itemAt(event.position().toPoint())
if not droppos: return
droppos = str(droppos.text(0))
if droppos.rfind(" ") != -1:
droppos = droppos[0:droppos.rfind(" ")]
if droppos == "Chums" or droppos in self.groups:
saveOpen = event.source().currentItem().isExpanded()
saveDrop = self.itemAt(event.pos())
saveDrop = self.itemAt(event.position().toPoint())
saveItem = self.takeTopLevelItem(self.indexOfTopLevelItem(event.source().currentItem()))
self.insertTopLevelItems(self.indexOfTopLevelItem(saveDrop)+1, [saveItem])
if saveOpen:
@ -540,12 +540,8 @@ class chumArea(RightClickTree):
self.mainwindow.config.saveGroups(gTemp)
# Drop item is a chum
else:
eventpos = event.position()
if type(eventpos) == QtCore.QPointF:
# Round if float, which it should be in PyQt6
item = self.itemAt(eventpos.toPoint())
else:
item = self.itemAt(eventpos)
eventpos = event.position().toPoint()
item = self.itemAt(eventpos)
if item:
text = str(item.text(0))
# Figure out which group to drop into
@ -1077,7 +1073,7 @@ class trollSlum(chumArea):
def contextMenuEvent(self, event):
#fuckin Qt
if event.reason() == QtGui.QContextMenuEvent.Reason.Mouse:
listing = self.itemAt(event.pos())
listing = self.itemAt(event.position().toPoint())
self.setCurrentItem(listing)
if self.currentItem().text(0) != "":
self.optionsMenu.popup(event.globalPos())

View file

@ -1,2 +1,2 @@
_pcVersion = "Alt. v2.4.1"
buildVersion = "v2.4.1"
_pcVersion = "Alt. v2.4.2"
buildVersion = "v2.4.2"