hw1016

hw1016_第1张图片

#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    //窗口
    this->setStyleSheet("border-radius:8");
    this->setWindowTitle("厉不厉害你坤哥");
    this->setWindowIcon(QIcon("C:\\Users\\qiujunhang\\Pictures\\Saved Pictures\\OIP-C.jfif"));
    this->resize(530,430);
    //this->setWindowFlag(Qt::FramelessWindowHint);
    this->setStyleSheet("background-color:pink");
    //上半背景
    QLabel *lab1=new QLabel(this);
    lab1->resize(530,155);
    QMovie *kk=new QMovie("C:\\Users\\qiujunhang\\Desktop\\参考文献\\01login\\01login\\icon\\dance.gif");
    lab1->setMovie(kk);//加载动图到标签
    lab1->setScaledContents(true);
    kk->start();
    //图标1
    QLabel *lab2= new QLabel(this);
    lab2->resize(40,40);
    lab2->move(120,190);
    lab2->setPixmap(QPixmap("C:\\Users\\qiujunhang\\Desktop\\参考文献\\01login\\01login\\icon\\zhanghu.png"));
    lab2->setScaledContents(true);
    //图标2
    QLabel *lab3= new QLabel(this);
    lab3->resize(40,40);
    lab3->move(120,250);
    lab3->setPixmap(QPixmap("C:\\Users\\qiujunhang\\Desktop\\参考文献\\01login\\01login\\icon\\passwd.jpg"));
    lab3->setScaledContents(true);
    //图标3
    QLabel *lab7= new QLabel(this);
    lab7->resize(60,60);
    lab7->move(235,120);
    lab7->setPixmap(QPixmap("C:\\Users\\qiujunhang\\Desktop\\参考文献\\01login\\01login\\icon\\kun.webp"));
    lab7->setScaledContents(true);
    //账号文本
    QLineEdit *ed1 =new QLineEdit(this);
    ed1->move(170,190);
    ed1->setPlaceholderText("账号");
    ed1->resize(220,40);
    //密码文本
    QLineEdit *ed2 =new QLineEdit(this);
    ed2->move(170,250);
    ed2->setPlaceholderText("密码");
    ed2->resize(220,40);

    //标签1
    QLabel *lab4=new QLabel(this);
    lab4->setText("自动登录");
    lab4->resize(60,30);
    lab4->move(120,310);
    //标签2
    QLabel *lab5=new QLabel(this);
    lab5->setText("记住密码");
    lab5->resize(60,30);
    lab5->move(220,310);
    //标签3
    QLabel *lab6=new QLabel(this);
    lab6->setText("找回密码");
    lab6->resize(60,30);
    lab6->move(320,310);
    //登录按钮
    QPushButton *btn1=new QPushButton("登录",this);
    btn1->resize(270,50);
    btn1->move(120,350);
    btn1->setStyleSheet("background-color:rgb(106,181,255)");


}

你可能感兴趣的:(c++)