0

I have some Qt properties and signals that are generated at runtime and I want to link them as if it were declared using the Q_PROPERTY macro. Is it possible?

Why I'm trying to do this: I made a COM component in C# that I am consuming in Qt using QAxObject. When I load the COM component at runtime, my COM properties get automatically converted to Qt properties and my COM property changed events to Qt signals. I want to link the Qt properties to their corresponding onChanged signals.

Looking at the QAxBase code, it looks like Qt would automatically do what I want if my COM component supported the IPropertyNotifySink interface, but from what I could tell (with much research and trial and error) it's not possible to do so from C# .NET.

Tony Clifton
  • 467
  • 3
  • 10
  • That sounds familiar but I cannot answer as you ask: https://stackoverflow.com/questions/47987953/document-completed-signal-inside-qt-using-qaxwidget/48011309#48011309 – Alexander V Feb 21 '18 at 15:00
  • Thanks, but not quite what I need. All of my signals and slots connections work fine. It's just a matter of adding a notify signal to a property. I know this is typically done through the moc file, but I'm hoping there is a dynamic way of doing it. – Tony Clifton Feb 21 '18 at 16:25
  • I mean my answer with activexEventHandler. That Qt COM wrapping is so buggy and since I intensively worked on it like 3 years ago still may be not fixed but you can tap in the signal source directly. – Alexander V Feb 21 '18 at 17:01
  • Seems to work pretty well for me. No issues with ActiveQt directly. My issues now are with .NET and/or the core Qt Meta-Object system. – Tony Clifton Feb 21 '18 at 17:09
  • Will you get a signal for the property value change? That is a question and that what I talk about. That is Qt side which is buggy. – Alexander V Feb 21 '18 at 17:14
  • Yes, I get a signal for property changes. The signals are emitted when the corresponding C# COM event is fired. – Tony Clifton Feb 21 '18 at 17:20
  • So, I described the mechanism for that with which you'd be able to create specific "fixed" signal for that type of property. I doubt you will find the solution otherwise. I myself was frustrated with QAx* stuff for a while. – Alexander V Feb 21 '18 at 18:13

0 Answers0