You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, November 11th 2011, 5:03pm

Signals with QAxServer in .NET

Hello,

I am developing a COM application by using QAxServer module in Qt. I reference and test the COM app in VB.NET. Till now I have successfully called slots and used properties. My problem is that I cannot assign a signal in the VB.NET code as any signal I write in qt is not visible in the COM headers.

eg.

signals:
void valueChanged(int v);

I also tested void, QString v, const Qstring &v and many other combinations in case that for compatibility reasons was needed a different datatype.

Can someone give me a working example of any COM signal with .NET?

Thank you a lot,
Orestis

2

Saturday, December 10th 2011, 10:05am

Hello guys,
Finally I made it, I present you my code in VB.NET

Qt code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class SomeClass : public QObject
{
    Q_OBJECT
Q_CLASSINFO("ClassID", "{SomeGUID}")
    Q_CLASSINFO("InterfaceID", "{SomeGUID}")
    Q_CLASSINFO("EventsID", "{SomeGUID}")
    Q_CLASSINFO("RegisterObject", "yes")

public:
	SomeClass(QObject *parent = 0);
signals:
	void someSignal(void);
public slots:
	void SomeSlot(void){emit someSignal();}
};


VB.NET code:

Source code

1
2
Public Class SomeClass 	
    Dim WithEvents SomeClass As SomeClassLib.SomeClass	        Private Sub SomeClass_SomeSignal() Handles SomeClass.SomeSignal 	            Signal code here	        End SubEnd Class