Widget::Widget(QWidget *parent): QWidget(parent)
{//==============窗口相关设置=======this->setFixedSize(540,720);//背景颜色this->setStyleSheet("background-color:white");//去掉头部this->setWindowFlag(Qt::FramelessWindowHint);//============标签相关设置=======QLabel *lab1 = new QLabel(this);//设置大小lab1->resize(50, 153);lab1->move(0,53);lab1->setPixmap(QPixmap("C:\\Users\\LENOVO\\Desktop\\pictrue\\lenovo.png"));//自动适应lab1->setScaledContents(true);QLabel *lab2 = new QLabel("账号密码登录",this);lab2->resize(220,50);lab2->move(110,60);QLabel *lab3 = new QLabel("忘记密码",this);lab3->resize(100,30);lab3->move(120,470);lab3->setStyleSheet("color:blue");QLabel *lab4 = new QLabel("没有账号吗?",this);lab4->resize(110,30);lab4->move(120,620);QLabel *lab5 = new QLabel("立即注册",this);lab5->resize(130,35);lab5->move(230,620);lab5->setStyleSheet("color:blue");//============行编辑器相关设置=======QLineEdit *edit1 = new QLineEdit(this);edit1->resize(330,48);edit1->move(120,180);edit1->setPlaceholderText("邮箱/手机号");QLineEdit *edit2 = new QLineEdit(this);edit2->resize(330,48);edit2->move(120,255);edit2->setPlaceholderText("密码");edit2->setEchoMode(QLineEdit::Password);//============按钮相关设置=======QPushButton *btn = new QPushButton("登录",this);btn->resize(180,55);btn->move(120,385);//样式函数setStyleSheet()btn->setStyleSheet("background-color:rgb(8,189,253);border-radius:5px;color:white");
}