作业
#include "mywidget.h"
MyWidget::MyWidget(QWidget *parent)
: QMainWindow(parent)
{
this->setWindowTitle("顶针的瑞克五代专卖店");
this->setWindowIcon(QIcon("C:\\Users\\yq173\\Desktop\\pictrue\\icon.png"));
this->setWindowFlags(Qt::FramelessWindowHint);
this->resize(550,530);
this->setStyleSheet("background-color:white");
QLabel *lab1 = new QLabel(this);
lab1->resize(550,250);
QMovie *gif = new QMovie("C:\\Users\\yq173\\Desktop\\pictrue\\gif.jpg");
lab1->setMovie(gif);
gif->start();
lab1->setScaledContents(true);
QLabel *lab2 = new QLabel(this);
lab2->setText("账号");
lab2->resize(40,40);
lab2->move(110,260);
QLabel *lab3 = new QLabel(this);
lab3->resize(40,40);
lab3->move(110,300);
lab3->setPixmap(QPixmap("C:\\Users\\yq173\\Desktop\\pictrue\\1.png"));
lab3->setScaledContents(true);
QLineEdit *edit1 = new QLineEdit(this);
edit1->resize(160,40);
edit1->move(150,300);
//edit1->setText("username");
edit1->setPlaceholderText("username");
QLineEdit *edit2 = new QLineEdit(this);
edit2->resize(160,40);
edit2->move(150,380);
edit2->setPlaceholderText("password");
edit2->setEchoMode(QLineEdit::Password);
QLabel *lab4 = new QLabel(this);
lab4->setText("密码");
lab4->resize(40,40);
lab4->move(110,340);
QLabel *lab5 = new QLabel(this);
lab5->resize(40,40);
lab5->move(110,380);
lab5->setPixmap(QPixmap("C:\\Users\\yq173\\Desktop\\pictrue\\2.png"));
lab5->setScaledContents(true);
QPushButton *btn1 = new QPushButton(this);
btn1->resize(160,60);
btn1->move(130,440);
btn1->setText("Login");
btn1->setStyleSheet("background-color:blue");
}
MyWidget::~MyWidget()
{
}