#include "ui_my_widget.h"
My_Widget::My_Widget(QWidget *parent)
this -> setWindowTitle("QQ聊天");
this -> setWindowIcon(QIcon(":/pictrue/pictrue/qq.png"));
ui-> logoLab ->setPixmap(QPixmap(":/pictrue/pictrue/logo.png"));
ui -> logoLab -> setScaledContents(true);
ui -> userNameLab -> resize(40,40);
ui -> userNameLab -> setPixmap(QPixmap(":/pictrue/pictrue/wodepeizhenshi.png"));
ui -> userNameLab -> setScaledContents(true);
ui -> passwdLab -> resize(40,40);
ui -> passwdLab ->setPixmap(QPixmap(":/pictrue/pictrue/passwd.jpg"));
ui -> passwdLab ->setScaledContents(true);
ui -> usrEdit ->setPlaceholderText("QQ账号/手机号码/QQ邮箱");
ui -> passwdEdit -> setPlaceholderText("请输入密码");
ui -> passwdEdit -> setEchoMode(QLineEdit::Password);
ui -> btn1 ->setIcon(QIcon(":/pictrue/pictrue/login.png"));
ui -> btn2 ->setIcon(QIcon(":/pictrue/pictrue/cancel.png"));
connect(ui ->btn1,&QPushButton::clicked,this,&My_Widget::btn1_slot);
connect(ui->btn2,SIGNAL(clicked()),this,SLOT(my_slot()));
void My_Widget::my_slot()
void My_Widget:: btn1_slot()
QString s = ui ->usrEdit->text();
QString v = ui ->passwdEdit->text();
if(s=="admin"&&v=="123456")
qDebug() << "登录失败,请正确输入" ;
ui->passwdEdit -> clear();