c++ - connecting SLOT error -
i have file programm.cpp control of connecting page when want connect 1 of programm.cpp functions other push button class gave error
this code :
qobject::connect(loginpage->buttons->button(qdialogbuttonbox::ok),signal(clicked()),this,slot(check_user())); and error :
/home/alireza/documents/qt/alireza/programm.cpp:19: error: no matching function call 'qobject::connect(qpushbutton*, const char*, programm* const, const char*)'
& function declaration commented :
void programm::check_user() { /*qstring user = loginpage->editpassword->displaytext(); qstring password = loginpage->combousername->currenttext(); qsqlquery myquery("select username teacherusers"); while(myquery.next()) { qstring username = mydb->query->value(0).tostring(); qstring pass = mydb->query->value(1).tostring(); qdebug()<<username << " " << pass ; //if (username == user) }*/ } programm.h :
#ifndef programm_h #define programm_h #include "login.h" #include "mainwindow.h" #include "nazem.h" #include "database.h" #include <qtgui> #include <qtcore> #include <qobject> class programm { q_object public: programm(); login *loginpage; mainwindow *mainwindowpage; nazem *nazm; database *mydb; public slots : void check_user(); }; #endif // programm_h
like said in comments... haven't derived qobject , haven't included q_object macro.
read docs.
Comments
Post a Comment