#include "widget.h"void Widget::my_slot()
{if((edit1->text()=="admin")&&(edit2->text()=="123456")){qDebug()<<"登陆成功";emit jump();close();}else{qDebug()<<"登陆失败";}
}void Widget::btn3_slot()
{this->close();}Widget::Widget(QWidget *parent): QWidget(parent)
{qDebug()<< this ->size();qDebug()<< this ->frameSize();qDebug()<< this ->rect().size();this->setFixedSize(430,310);//this->setWindowFlag(Qt::FramelessWindowHint);//设置窗口标题this->setWindowTitle("QQ");//获取窗口标题qDebug()<< this->windowTitle();//设置窗口的图标this->setWindowIcon(QIcon("F:\\tubiao\\icon_z8w8m9orsdk\\QQ.png"));//窗口颜色this->setStyleSheet("background-color:white;color:read;");//标签lab1 = new QLabel(this);//标签账户密码lab3 = new QLabel("账户:",this);lab3->resize(50,30);lab3->move(100,150);lab3->setPixmap(QPixmap("F:\\tubiao\\icon_z8w8m9orsdk\\33.png"));lab3->setScaledContents(true);lab4 = new QLabel("密码:",this);lab4->resize(lab3->size());lab4->move(100,180);lab4->setPixmap(QPixmap("F:\\tubiao\\icon_z8w8m9orsdk\\denglumima.png"));lab4->setScaledContents(true);//标签颜色lab1->setStyleSheet("background-color:skyblue;");lab1->resize(430,110);//标签图lab1->setPixmap(QPixmap("F:\\tubiao\\icon_z8w8m9orsdk\\77.png"));lab1->setScaledContents(true);//行编辑edit1 = new QLineEdit(this);edit1->resize(120,30);edit1->move(150,150);//edit1->setStyleSheet("border:none;");edit1->setPlaceholderText("QQ号");edit2 = new QLineEdit("密码",this);edit2->resize(edit1->size());edit2->move(150,180);//edit1->setStyleSheet("border:none;");//edit2->setPlaceholderText("QQ号");//QDebug()edit2->text();edit2->setPlaceholderText("QQ密码");edit2->setEchoMode(QLineEdit::Password);//登录取消btn1 = new QPushButton(this);btn1->setText("登录");btn1->resize(100,40);btn1->move(50,240);btn1->setEnabled(true);btn1->setIcon(QIcon("F:\\tubiao\\icon_z8w8m9orsdk\\denglu_1.png"));btn2 = new QPushButton(this);btn2->setText("取消");btn2->resize(100,40);btn2->move(250,240);btn2->setEnabled(true);btn2->setIcon(QIcon("F:\\tubiao\\icon_z8w8m9orsdk\\quxiao.png"));//btn3 = new QPushButton("按钮3", this);connect(this->btn1,&QPushButton::clicked,[=](){this->my_slot();});
// connect(this->btn2,&QPushButton::clicked,this,&Widget::btn3_slot);
}Widget::~Widget()
{}