我有文件 programm.cpp 来控制我的所有连接页面,但是当我想将 programm.cpp 函数之一连接到另一个类的其他按钮时,我给出了一个错误
这是代码:
QObject::connect(LoginPage->Buttons->button(QDialogButtonBox::Ok),SIGNAL(clicked()),this,SLOT(check_user()));
这是错误:
/home/alireza/Documents/qt/ALIREZA/programm.cpp:19: 错误: 没有匹配函数调用'QObject::connect(QPushButton*, const char*, programm* const, const char*)'
& 这也是完全注释的函数声明:
void programm::check_user()
{
/*QString user = LoginPage->EditPassWord->displayText();
QString password = LoginPage->ComboUsername->currentText();
QSqlQuery myquery("SELECT Username FROM TeacherUsers");
while(myquery.next())
{
QString Username = MyDB->query->value(0).toString();
QString pass = MyDB->query->value(1).toString();
qDebug()<<Username << " " << pass ;
//if (Username == user)
}*/
}
程序.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