作业--day42

界面设计

MyProWin::MyProWin(QWidget *parent)
    : QMainWindow(parent)
{
    /**********窗口主体**********/

    //窗口大小
    this->setFixedSize(644, 493);
    this->setWindowTitle("QQ");
    this->setWindowIcon(QIcon("C:/Users/10988/Downloads/pictrue/pictrue/qq.png"));
    this->setStyleSheet("background-color:white");
    this->setWindowFlag(Qt::FramelessWindowHint);

    /*********标签内容**********/

    //上部内容label
    QLabel *upper_lab =  new QLabel(this);
    upper_lab->resize(644, 290);
    upper_lab->setScaledContents(true);
    QMovie *upper_mv = new QMovie("C:/Users/10988/Downloads/pictrue/pictrue/qq2.gif");
    upper_lab->setMovie(upper_mv);
    upper_mv->start();

    //QQ的图标label
    QLabel *qq_upper_lab =  new QLabel(this);
    qq_upper_lab->move(30, 20);
    qq_upper_lab->setScaledContents(true);
    qq_upper_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/QQicon.png"));
    qq_upper_lab->resize(50,50);
    qq_upper_lab->setStyleSheet("background-color:transparent");

    //账号label
    QLabel *account_lab = new QLabel(this);
    account_lab->move(145,260);
    account_lab->setScaledContents(true);
    account_lab->resize(25,30);
    account_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/QQaccount.png"));

    //密码label
    QLabel *pwd_lab = new QLabel(this);
    pwd_lab->move(145,310);
    pwd_lab->setScaledContents(true);
    pwd_lab->resize(25,30);
    pwd_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/qqpwd.png"));

    //头像label
    QLabel *img_lab = new QLabel(this);
    img_lab->move(270,140);
    img_lab->setScaledContents(true);
    img_lab->resize(100,100);
    //设置透明背景
    img_lab->setStyleSheet("background-color:transparent");
    img_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/boy_h.png"));

    //找回密码label
    QLabel *fpwd_lab = new QLabel(this);
    fpwd_lab->move(440, 350);
    fpwd_lab->setScaledContents(true);
    fpwd_lab->setText("找回密码");

    //注册账号label
    QLabel *reg_lab = new QLabel(this);
    reg_lab->move(30, 450);
    reg_lab->setScaledContents(true);
    reg_lab->setText("注册账号");

    //二维码label
    QLabel *qr_lab = new QLabel(this);
    qr_lab->move(580,450);
    qr_lab->setScaledContents(true);
    qr_lab->resize(25,25);
    qr_lab->setPixmap(QPixmap("C:/Users/10988/Downloads/pictrue/pictrue/qr.png"));

    /**********输入框**************/

    //账号输入框
    QLineEdit *account_le = new QLineEdit(this);
    account_le->setPlaceholderText("QQ号码/手机/邮箱");
    account_le->resize(345,30);
    account_le->move(175, 260);

    //密码输入框
    QLineEdit *pwd_le = new QLineEdit(this);
    pwd_le->setEchoMode(QLineEdit::Password);
    pwd_le->resize(345,30);
    pwd_le->move(175, 310);

    /***********确认框************/

    //自动登录框
    QCheckBox *login_ck = new QCheckBox(this);
    login_ck->move(145, 350);
    login_ck->setText("自动登录");

    //记住密码框
    QCheckBox *pwd_ck = new QCheckBox(this);
    pwd_ck->move(300, 350);
    pwd_ck->setText("记住密码");

    /*************按钮*************/
    //登录按钮
    QPushButton *login_bnt = new QPushButton(this);
    login_bnt->move(145,400);
    login_bnt->resize(370, 60);
    login_bnt->setText("登录");
    login_bnt->setStyleSheet("background-color:rgb(70,127,231)");
}

在这里插入图片描述

思维导图

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值