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

nativeEvent always receives empty message with size 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9.0
    • PySide, Shiboken
    • None
    • Python 3.13.2 (tags/v3.13.2:4f8bb39, Feb 4 2025, 15:23:48) [MSC v.1942 64 bit (AMD64)] on win32
      PySide6 6.9.0
      shiboken6 6.9.0
      Windows 11
    • Windows

      Minimal example

      from PySide6.QtWidgets import QWidget, QApplication
      
      class Window(QWidget):
          def nativeEvent(self, eventType, message):
              print(eventType, message, message.toBytes())
              return super().nativeEvent(eventType, message)
      
      app = QApplication()
      window = Window()
      window.show()
      app.exec()
      

      message always has Size 0 and message.toBytes() is always empty:

      b'windows_generic_MSG' shiboken6.Shiboken.VoidPtr(Address 0x00000088B40D9D80, Size 0, isWritable False) b''
      b'windows_generic_MSG' shiboken6.Shiboken.VoidPtr(Address 0x00000088B40DAF60, Size 0, isWritable False) b''
      b'windows_generic_MSG' shiboken6.Shiboken.VoidPtr(Address 0x00000088B40DAF60, Size 0, isWritable False) b''
      b'windows_generic_MSG' shiboken6.Shiboken.VoidPtr(Address 0x00000088B40DAF60, Size 0, isWritable False) b''
      b'windows_generic_MSG' shiboken6.Shiboken.VoidPtr(Address 0x00000088B40DAF60, Size 0, isWritable False) b''
      

      Is this intentional or a bug?

      Also asked on forum.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            buffered555 Emily May
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes