mickey
8th March 2006, 14:41
I I have code this below but I have and error on 1th connect
mywidget.cpp(113): error C2664: 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *)' : cannot convert parameter 3 from 'myMainForm *' to 'const QObject *'
//constructor of MyWidget class
w = (MainForm*)this->topLevelWidget();
myw= (myMainForm*)this->topLevelWidget();
connect(this, SIGNAL(myUpdate()), myw, SLOT(myUpdateWidgets()) );
connect(this, SIGNAL(myUpdate()), w, SLOT(updateWidgets()) );
class MyWidget {
MainForm* w;
myMainForm* myw;
}
The 2nd connect works properly; Why this error on 1th? Isn't it the same? Thanks
mywidget.cpp(113): error C2664: 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *)' : cannot convert parameter 3 from 'myMainForm *' to 'const QObject *'
//constructor of MyWidget class
w = (MainForm*)this->topLevelWidget();
myw= (myMainForm*)this->topLevelWidget();
connect(this, SIGNAL(myUpdate()), myw, SLOT(myUpdateWidgets()) );
connect(this, SIGNAL(myUpdate()), w, SLOT(updateWidgets()) );
class MyWidget {
MainForm* w;
myMainForm* myw;
}
The 2nd connect works properly; Why this error on 1th? Isn't it the same? Thanks