1.
#include "widget.h"Widget::Widget(QWidget *parent): QWidget(parent)
{this->setFixedSize(520,420);this->setWindowIcon(QIcon("C:\\Users\\79889\\Desktop\\wzg.jpg"));this->setWindowTitle("华清远见");QPushButton *btn1 = new QPushButton;btn1->setParent(this);btn1->setText("登录");btn1->resize(80,40);btn1->move(390,330);QPushButton *btn2 = new QPushButton(this);btn2->setText("注册");btn2->resize(btn1->size());btn2->move(btn1->x()-130,btn1->y());QLineEdit *edit1 = new QLineEdit(this);edit1->resize(270,35);edit1->setPlaceholderText("手机号/邮箱");edit1->move(150,190);QLineEdit *edit2 = new QLineEdit(this);edit2->resize(edit1->size());edit2->setPlaceholderText("密码");edit2->setEchoMode(QLineEdit::Password);edit2->move(150,240);QLabel *tab1 = new QLabel(this);tab1->resize(35,35);tab1->setPixmap(QPixmap("C:\\Users\\79889\\Desktop\\suo.png"));tab1->move(edit2->x()-50,edit2->y());tab1->setScaledContents(true);QLabel *tab2 = new QLabel(this);tab2->resize(tab1->size());tab2->setPixmap(QPixmap("C:\\Users\\79889\\Desktop\\bag.png"));tab2->move(tab1->x(),tab1->y()-50);tab2->setScaledContents(true);QLabel *tab3 = new QLabel(this);tab3->resize(520,180);tab3->setPixmap(QPixmap("C:\\Users\\79889\\Desktop\\hqyj.png"));tab3->setScaledContents(true);}Widget::~Widget()
{
}
2