7.25 作业

1.做一个登录界面

#include "widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    this->setFixedSize(800,600);
    this->setWindowOpacity(0.9);
    this->setWindowTitle("登录");
    this->setWindowIcon(QIcon("E:\\hqyj\\Qt\\icon_h8db9qyxft\\QQ.png"));

    logo = new QLabel(this);
    logo->resize(800,300);
    logo->setPixmap(QPixmap("E:\\hqyj\\Qt\\icon_h8db9qyxft\\112.bmp"));
    logo->setScaledContents(true);

    ulabel = new QLabel(this);
    ulabel->move(200,320);
    ulabel->resize(50,50);
    ulabel->setPixmap(QPixmap("E:\\hqyj\\Qt\\icon_h8db9qyxft\\denglu.png"));
    ulabel->setScaledContents(true);

    uline = new QLineEdit(this);
    uline->resize(300,50);
    uline->move(300,320);
    uline->setPlaceholderText("输入账号");

    plabel = new QLabel(this);
    plabel->move(200,400);
    plabel->resize(50,50);
    plabel->setPixmap(QPixmap("E:\\hqyj\\Qt\\icon_h8db9qyxft\\denglumima.png"));
    plabel->setScaledContents(true);

    pline = new QLineEdit(this);
    pline->resize(300,50);
    pline->move(300,400);
    pline->setPlaceholderText("输入密码");
    pline->setEchoMode(QLineEdit::Password);

    loginbutton = new QPushButton(QIcon("E:\\hqyj\\Qt\\icon_h8db9qyxft\\denglu_1.png"),
                                  "登录",this);
    loginbutton->resize(100,30);
    loginbutton->move(280,500);

    cancelbutton = new QPushButton(QIcon("E:\\hqyj\\Qt\\icon_h8db9qyxft\\quxiao.png"),
                                   "取消",this);
    cancelbutton->resize(100,30);
    cancelbutton->move(420,500);
}

Widget::~Widget()
{
}

7.25 作业_第1张图片

 2.思维导图

7.25 作业_第2张图片

 

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