Skip to content

Conversation

@bmjcode
Copy link
Collaborator

@bmjcode bmjcode commented Jun 14, 2025

Fixes #2002.

Copy link
Member

@fedelibre fedelibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the unique occurrence. There are others to be fixed:

$ git grep -nw globalPos
frescobaldi/doclist/widget.py:158:            menu.exec(doc, ev.globalPos())
frescobaldi/doclist/widget.py:197:        menu.exec(ev.globalPos())
frescobaldi/quickinsert/buttongroup.py:180:            QToolTip.showText(ev.globalPos(), text)
frescobaldi/quickinsert/buttongroup.py:188:        m.exec(ev.globalPos())
frescobaldi/tabbar.py:188:            self.contextMenu().exec(self.docs[index], ev.globalPos())
frescobaldi/viewers/pdfwidget.py:207:                editinplace.edit(self, cursor, ev.globalPos())
frescobaldi/widgets/charmap.py:204:                        QToolTip.showText(ev.globalPos(), text, self, rect)
frescobaldi/widgets/charmap.py:217:                    QWhatsThis.showText(ev.globalPos(), text, self)
frescobaldi/widgets/imageviewer.py:128:            self._startpos = ev.globalPos()
frescobaldi/widgets/imageviewer.py:131:        diff = self._startpos - ev.globalPos()
frescobaldi/widgets/imageviewer.py:133:            self._startpos = ev.globalPos()
frescobaldi/widgets/imageviewer.py:144:                mode == DRAG and ev.globalPos() == self._startpos):

@fedelibre
Copy link
Member

Maybe there are other deprecated methods.

@bmjcode
Copy link
Collaborator Author

bmjcode commented Jun 14, 2025

@fedelibre Some (most?) of those handle different types of events. For example, the one in tabbar.py is a QContextMenuEvent, which does still have a globalPos() method.

You know I'm quite comfortable programming with sed, but this is one of those things I think it's best to handle case by case.

@fedelibre
Copy link
Member

Ok, I thought it was a changed needed everywhere.

@bmjcode bmjcode merged commit 1888d97 into frescobaldi:master Jun 16, 2025
@bmjcode bmjcode deleted the qt6-viewmanager-showcontextmenu branch June 16, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'QMouseEvent' object has no attribute 'globalPos'

2 participants