cpp
#include "login_interface.h"
Login_interface::Login_interface(QWidget *parent)
: QMainWindow(parent)
{
//设置窗口标题及图像
this->setFixedSize(480, 300);
this->setWindowTitle("华清远见");
this->setWindowIcon(QIcon("C:\\Users\\Acer\\Desktop\\icon\\icon\\wodepeizhenshi.png"));
//设置背景
QLabel* lab1 = new QLabel(this);
lab1->resize(480,140);
lab1->setPixmap(QPixmap("C:\\Users\\Acer\\Desktop\\icon\\icon\\logo"));
lab1->setScaledContents(true);
// QMovie *mov = new QMovie("C:\\Users\\Acer\\Desktop\\icon\\icon\\aikun");
// mov->start();
// lab1->setMovie(mov);
//设置标签
QLabel* lab2 = new QLabel(this);
QLabel* lab3 = new QLabel(this);
lab2->resize(32, 36);
lab2->move(50, 160);
lab2->setPixmap(QPixmap("C:\\Users\\Acer\\Desktop\\icon\\icon\\userName"));
lab2->setScaledContents(true);
lab3->resize(32, 36);
lab3->move(50, 210);
lab3->setPixmap(QPixmap("C:\\Users\\Acer\\Desktop\\icon\\icon\\passwd"));
lab3->setScaledContents(true);
//设置行文本
QLineEdit *lin1 = new QLineEdit(this);
lin1->resize(270, 32);
lin1->move(lab2->x()+40,lab2->y()+2);
lin1->setPlaceholderText("账号/邮箱/手机号");
QLineEdit *lin2 = new QLineEdit(this);
lin2->resize(270, 32);
lin2->move(lab3->x()+40,lab3->y()+2);
lin2->setEchoMode(QLineEdit::Password);
//设置按钮
QPushButton* but1 = new QPushButton(this);
but1->resize(80, 35);
but1->move(120, 255);
but1->setIcon(QIcon("C:\\Users\\Acer\\Desktop\\icon\\icon\\login"));
but1->setText("登录");
QPushButton* but2 = new QPushButton(this);
but2->resize(80, 35);
but2->move(280, 255);
but2->setIcon(QIcon("C:\\Users\\Acer\\Desktop\\icon\\icon\\cancel"));
but2->setText("取消");
//设置选项
QCheckBox *rad1 = new QCheckBox(this);
rad1->move(lin1->x()+280,lin1->y());
rad1->setText("自动登录");
rad1->resize(100, 32);
QCheckBox *rad2 = new QCheckBox(this);
rad2->move(lin2->x()+280,lin2->y());
rad2->setText("记住密码");
rad2->resize(100, 32);
}
Login_interface::~Login_interface()
{
}