Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. cannot access QAxWidget custom event/methods with PyQt6/PySide6
Forum Updated to NodeBB v4.3 + New Features

cannot access QAxWidget custom event/methods with PyQt6/PySide6

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 3 Posters 555 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kwiechen
    wrote on last edited by kwiechen
    #1

    Hi,

    I am using a .NET control exposed via COM Interop with a custom event TextModified() and a custom method getText()

    The following code is working without problems with PyQt5 but I cannot access custom events or methods of this control using PyQt6/PySide6. The control is loaded and displayed correctly.

    class MainForm(QMainWindow):
    def init(self, parent=None):
    super(MainForm, self).init(parent)

        self.widget = QWidget()
        self.layout = QVBoxLayout()
        self.axWidget = QAxWidget("my ID")
        self.axWidget.TextModified.connect(self.notify)
        self.layout.addWidget(self.axWidget)
        self.widget.setLayout(self.layout)
        self.setCentralWidget(self.widget)
    
    def notify(self):
        print(self.axWidget.getText())
    
    JonBJ 1 Reply Last reply
    0
    • K kwiechen

      Hi,

      I am using a .NET control exposed via COM Interop with a custom event TextModified() and a custom method getText()

      The following code is working without problems with PyQt5 but I cannot access custom events or methods of this control using PyQt6/PySide6. The control is loaded and displayed correctly.

      class MainForm(QMainWindow):
      def init(self, parent=None):
      super(MainForm, self).init(parent)

          self.widget = QWidget()
          self.layout = QVBoxLayout()
          self.axWidget = QAxWidget("my ID")
          self.axWidget.TextModified.connect(self.notify)
          self.layout.addWidget(self.axWidget)
          self.widget.setLayout(self.layout)
          self.setCentralWidget(self.widget)
      
      def notify(self):
          print(self.axWidget.getText())
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @kwiechen
      If you don't get an answer here and it works under PyQt5 but not PyQt6 you could ask the PyQt folks. I don't know whether this is a Py... issue or an underlying Qt6 one.

      K 1 Reply Last reply
      0
      • JonBJ JonB

        @kwiechen
        If you don't get an answer here and it works under PyQt5 but not PyQt6 you could ask the PyQt folks. I don't know whether this is a Py... issue or an underlying Qt6 one.

        K Offline
        K Offline
        kwiechen
        wrote on last edited by
        #3

        @JonB
        I have tested my custom ActiveX using Qt6/C++ without problems. Using Python the QAx.Widget.generateDocumentation() is correct. I think that PyQt5 is autmatically defining signals and methods but PySide6/PyQt6 not. A solution is to subclass QAxWidget defining the ActiveX events/signals explicitly and calling the methods via dynamicCall()

        SGaistS 1 Reply Last reply
        0
        • K kwiechen

          @JonB
          I have tested my custom ActiveX using Qt6/C++ without problems. Using Python the QAx.Widget.generateDocumentation() is correct. I think that PyQt5 is autmatically defining signals and methods but PySide6/PyQt6 not. A solution is to subclass QAxWidget defining the ActiveX events/signals explicitly and calling the methods via dynamicCall()

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          It sounds like a regression then since it used to work.

          Did you already check the bug report system ?

          If there's nothing there, then please consider opening a new report with your findings.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved