Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, March 2002
AW: Q_OBJECT and Inheritance


Message 1 in thread

Please check your runtimemessage again:

	"No such signal C::mySlot()" sounds like a syntax error.

The message should be:
	"No such signal X::mySignal()" or
	"No such slot C::mySlot()"

Maybe you have done this in your original code?
	connect(this, SIGNAL(mySignal()), C->getARef(), SIGNAL(mySlot()));
...

-----Ursprüngliche Nachricht-----
Von: Shadow [mailto:jordifernandez@tavil.net]
Gesendet: Dienstag, 12. März 2002 12:11
An: qt-interest@trolltech.com
Betreff: Q_OBJECT and Inheritance


Hello All,

I have a code like this:

class A
{
   Q_OBJECT
   (...)
   
public slots:
   virtual void mySlot()
};

class B
{
   Q_OBJECT
   (...)

};

class C
{
   A* ARef;
public:
   C(A& _ARef) {ARef = &_ARef}
   A* getARef() {return ARef}
};


class X
{
   A* AInstance;
   C* CInstance;
public:
   X()
   {
      AInstance = new A;
      CInstance = new C(*A);
   }

X::foreignFunction(...)
{
   (...)
   connect(this, SIGNAL(mySignal()), C->getARef(), SLOT(mySlot()));
   (...)
}

My problem is that when i did such connection qDebugger says me:
No such signal C::mySlot() !!!.

I Know i cant reimplement mySlot() slot in C class but isn't my
prurpose cos C class is "client class" that can be developed by thirth
party developers and I don't want explain they mySlot purpose.

Thanks for your support.

-- 
 [ signature omitted ]