vaas
2nd April 2010, 12:18
hey guys.In my application i'm creating an instance of Dialogtest(a dialog i created).so whenever that dialog opens up and the user clicks on the find button it invokes finclicked() slot which will emit a signal .
I used the signal/slot connection mechanism to connect this emitted signal to a slot of the Mainwindow(parent of the dialog).
The code is compiling but when i run the app and press the find button of the dialog it gives the following error in Application output.
Object::connect: No such signal Dialogtest::csearch(const QString& a,Qt::CaseSensitivity cs)
Object::connect: (sender name: 'Dialogtest')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal Dialogtest::csearch(const QString& a,Qt::CaseSensitivity cs,const QString& c)
Object::connect: (sender name: 'Dialogtest')
Object::connect: (receiver name: 'MainWindow')
Dialogtest.h is:
.........
signals:
void csearch(const QString&,Qt::CaseSensitivity cs);
void csearch(const QString&,Qt::CaseSensitivity cs,const QString&);
private slots:
void enablefind();
void findclicked();
........
Dialogtest.cpp
if(ui->replaceEdit->isEnabled()){
rstring =ui->replaceEdit->text();
emit csearch(fstring,cs,rstring);
}
else{
emit csearch(fstring,cs);}
Mainwindow.h
protected slots:
void sear(QString& c,Qt::CaseSensitivity cs,QString& x);
void sear(QString& c,Qt::CaseSensitivity cs);
Mainwindow.cpp
//inside a function that opens a dialog;
t=new Dialogtest(this);
t->exec();
QObject::connect (t,SIGNAL(csearch(const QString& a,Qt::CaseSensitivity cs)),this,SLOT(sear(const QString& c,Qt::CaseSensitivity cs)));
QObject::connect (t,SIGNAL(csearch(const QString& a,Qt::CaseSensitivity cs,const QString& c)),this,SLOT(sear(const QString& a,Qt::CaseSensitivity cs,const QString& c)));
the slots sear() are defined in Mainwindow.cpp
plz help me with this.
I used the signal/slot connection mechanism to connect this emitted signal to a slot of the Mainwindow(parent of the dialog).
The code is compiling but when i run the app and press the find button of the dialog it gives the following error in Application output.
Object::connect: No such signal Dialogtest::csearch(const QString& a,Qt::CaseSensitivity cs)
Object::connect: (sender name: 'Dialogtest')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal Dialogtest::csearch(const QString& a,Qt::CaseSensitivity cs,const QString& c)
Object::connect: (sender name: 'Dialogtest')
Object::connect: (receiver name: 'MainWindow')
Dialogtest.h is:
.........
signals:
void csearch(const QString&,Qt::CaseSensitivity cs);
void csearch(const QString&,Qt::CaseSensitivity cs,const QString&);
private slots:
void enablefind();
void findclicked();
........
Dialogtest.cpp
if(ui->replaceEdit->isEnabled()){
rstring =ui->replaceEdit->text();
emit csearch(fstring,cs,rstring);
}
else{
emit csearch(fstring,cs);}
Mainwindow.h
protected slots:
void sear(QString& c,Qt::CaseSensitivity cs,QString& x);
void sear(QString& c,Qt::CaseSensitivity cs);
Mainwindow.cpp
//inside a function that opens a dialog;
t=new Dialogtest(this);
t->exec();
QObject::connect (t,SIGNAL(csearch(const QString& a,Qt::CaseSensitivity cs)),this,SLOT(sear(const QString& c,Qt::CaseSensitivity cs)));
QObject::connect (t,SIGNAL(csearch(const QString& a,Qt::CaseSensitivity cs,const QString& c)),this,SLOT(sear(const QString& a,Qt::CaseSensitivity cs,const QString& c)));
the slots sear() are defined in Mainwindow.cpp
plz help me with this.