Skip to content

Commit

Permalink
Merge pull request #1057 from vasole/globalPos
Browse files Browse the repository at this point in the history
[GUI] QMouseEvent.globalPos deprecated in PyQt6
  • Loading branch information
vasole authored Dec 8, 2023
2 parents 6a4cbc8 + 22b992b commit c8e3b6f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions PyMca5/PyMcaGui/plotting/LegendSelector.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#/*##########################################################################
# Copyright (C) 2015-2022 European Synchrotron Radiation Facility
# Copyright (C) 2015-2023 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
# the ESRF.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,7 +23,7 @@
# THE SOFTWARE.
#
#############################################################################*/
__author__ = "T. Rueter - ESRF Data Analysis"
__author__ = "T. Rueter - ESRF"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
Expand Down Expand Up @@ -561,7 +561,11 @@ def editorEvent(self, event, model, option, modelIndex):
# Mouse events are sent to editorEvent()
# even if they don't start editing of the item.
if event.button() == qt.Qt.RightButton and self.contextMenu:
self.contextMenu.exec(event.globalPos(), modelIndex)
if qt.BINDING in ["PyQt5", "PySide2"]:
self.contextMenu.exec(event.globalPos(), modelIndex)
else:
self.contextMenu.exec(event.globalPosition().toPoint(),
modelIndex)
return True
elif event.button() == qt.Qt.LeftButton:
# Check if checkbox was clicked
Expand Down

0 comments on commit c8e3b6f

Please sign in to comment.