cannot access QAxWidget custom event/methods with PyQt6/PySide6
-
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())
-
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())
-
@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.@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() -
@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()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.