Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2857

QMouseEvent: globalPosition() returns local position

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.7.2
    • PySide
    • None
    • Linux/X11

    Description

      On Linux both methods `QMouseEvent::globalPosition()` and `QMouseEvent:position()` return local position (on Windows everything's fine):

      from PySide6.QtWidgets import QApplication
      from PySide6.QtWidgets import QWidget
      
      
      class Widget(QWidget):
          def mousePressEvent(self, event):
              assert event.globalPosition() != event.position(), "same"
      
      
      def main():
          app = QApplication([])
          widget = Widget()
          widget.show()
          return app.exec()
      
      
      if _name_ == "_main_":
          raise SystemExit(main()) 

      Attachments

        1. pyside2857.py
          0.6 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            gatsik Gatsik 0
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes