connect problem
Verfasst: 3. Juni 2006 16:40
habe 2 Klassen:
und
in dem Konstruktor von Button hab ich jetzt connects:
Jetzt sagt er folgendes:
no matching function fount to call to 'Button::connect(Button* const,const char[20],LCD*&,const char[20],Qt::ConectionType)'
canidates are:
static bool QObject::connect( const QObject*,const char*,const QObject*,const char*,Qt::ConectionType)'
bool QObject::connect( const QObject*,const char*,const QObject*,const char*,Qt::ConectionType)'
Was heißt das? Was muss ich tun?
Code: Alles auswählen
class Button:public QPushButton
{
Q_OBJECT
private:
int number;
public:
Button(int value,std::string name,
int x,int y,int w,int h,
QWidget* parent,LCD*lcd);
short getNumber() const;
signals:
void myClicked(Button*button);
public slots:
void sendLcdPointer();
};
Code: Alles auswählen
class LCD:public QLCDNumber
{
Q_OBJECT
private:
int maxRange;
public:
LCD(int digits,
int x,int y,int w,int h,
QWidget*parent);
public slots:
void newNumber(Button*button);
};
Code: Alles auswählen
Button::Button(int value,std::string name,
int x,int y,int w,int h,
QWidget*parent,LCD*lcd):
QPushButton(name.c_str(),parent),number(value)
{
this->setGeometry(x,y,w,h);
QObject::connect(this,SIGNAL( clicked() ),
this,SLOT ( sendLcdPointer() ),
Qt::DirectConnection);
QObject::connect(this, SIGNAL( myClicked(Button*) ),
lcd, SLOT ( newNumber(Button*) ),
Qt::DirectConnection);
}
no matching function fount to call to 'Button::connect(Button* const,const char[20],LCD*&,const char[20],Qt::ConectionType)'
canidates are:
static bool QObject::connect( const QObject*,const char*,const QObject*,const char*,Qt::ConectionType)'
bool QObject::connect( const QObject*,const char*,const QObject*,const char*,Qt::ConectionType)'
Was heißt das? Was muss ich tun?