problem with signals/slots
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:
Code:
.........
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
Code:
if(ui->replaceEdit->isEnabled()){
rstring =ui->replaceEdit->text();
emit csearch(fstring,cs,rstring);
}
else{
emit csearch(fstring,cs);}
Mainwindow.h
Code:
protected slots:
void sear(QString& c,Qt::CaseSensitivity cs,QString& x);
void sear(QString& c,Qt::CaseSensitivity cs);
Mainwindow.cpp
Code:
//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.
Re: problem with signals/slots
In connect method we only give the argument types for signals and slots. We dont give the argument name.
So a, cs and c shouldn't be in the connect lines.
Re: problem with signals/slots
thank u...and can any one tell me if it is possible in qt to create custom ui(like u see in Avast antivirus).can it be done using stylesheets or is there any other way(i want to change the title bar also)
Re: problem with signals/slots