QT DAY1

#include "mywidget.h"

MyWidget::MyWidget(QWidget *parent)
    : QWidget(parent)
{
    this->setWindowTitle("EXVSDB");
    this->setWindowIcon(QIcon("C:\\Users\\dyj\\Pictures\\exvs2xb-title.png"));
    this->resize(540, 410);
    //设置纯净窗口 去掉头部
    this->setWindowFlag(Qt::FramelessWindowHint);
    //设置背景颜色
    this->setStyleSheet("background-color:White");

    QLabel *lab1 = new QLabel(this);
    lab1->resize(540, 157);
    lab1->setStyleSheet("background-color:pink");

    //设置动图
    QMovie *mv = new QMovie("C:\\Users\\dyj\\Pictures\\bili_v_1699873038780.gif");
    //将动图放进lab1中
    lab1->setMovie(mv);
    mv->start();
    //将动图自动适应lab
    lab1->setScaledContents(true);

    QLabel *lab2 = new QLabel(this);
    lab2->move(130,220);
    lab2->resize(20,20);
    lab2->setPixmap(QPixmap("C:\\Users\\dyj\\Desktop\\pictrue\\userName.jpg"));
    lab2->setScaledContents(true);

    QLabel *lab3 = new QLabel(this);
    lab3->move(130,250);
    lab3->resize(20,20);
    lab3->setPixmap(QPixmap("C:\\Users\\dyj\\Desktop\\pictrue\\passwd.jpg"));
    lab3->setScaledContents(true);
    QLabel *lab4 = new QLabel(this);
    lab4->resize(25,25);
    lab4->move(510,5);
    lab4->setPixmap(QPixmap("C:\\Users\\dyj\\Desktop\\pictrue\\R-C.png"));
    lab4->setScaledContents(true);

    QLineEdit *edit1 = new QLineEdit(this);
    edit1->resize(280, 20);
    edit1->move(150, 220);


    QLineEdit *edit2 = new QLineEdit(this);
    edit2->resize(280, 20);
    edit2->move(150, 250);
    edit2->setEchoMode(QLineEdit::Password);

    QPushButton *btn1 = new QPushButton(this);
    btn1->move(130, 300);
    btn1->resize(300,45);
    btn1->setText("登录");
    btn1->setStyleSheet("background-color:SteelBlue;border-radius:10px");
}

MyWidget::~MyWidget()
{

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值