QT day1

在这里插入图片描述

#include "widget.h"
#include "ui_widget.h"
#include <QIcon>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setWindowIcon(QIcon("D:/QTProj/C++/icon/QQ.png"));
    setWindowTitle("Login");
    setFixedSize(500,400);
    QLabel *labLogo = new QLabel(this);
    labLogo->resize(500,150);
    labLogo->setPixmap(QPixmap("D:/QTProj/C++/icon/logo.jpg"));
    labLogo->setScaledContents(true);
    QLabel *labAccount = new QLabel(this);
    labAccount->resize(50,50);
    labAccount->setPixmap(QPixmap("D:/QTProj/C++/icon/denglu.png"));
    labAccount->setScaledContents(true);
    labAccount->move(100,200);
    QLabel *labPassword = new QLabel(this);
    labPassword->resize(50,50);
    labPassword->setPixmap(QPixmap("D:/QTProj/C++/icon/denglumima.png"));
    labPassword->setScaledContents(true);
    labPassword->move(100,280);
    QLineEdit *editAccount = new QLineEdit(this);
    editAccount->resize(200,50);
    editAccount->move(180,200);
    editAccount->setPlaceholderText("账号");
    QLineEdit *editPassword = new QLineEdit(this);
    editPassword->resize(200,50);
    editPassword->move(180,280);
    editPassword->setPlaceholderText("密码");
    editPassword->setEchoMode(QLineEdit::Password);
    QPushButton* btnLogin = new QPushButton("登录",this);
    btnLogin->setIcon(QIcon("D:/QTProj/C++/icon/denglu_1.png"));
    btnLogin->resize(100,50);
    btnLogin->move(250,340);
    QPushButton* btnCancel = new QPushButton("取消",this);
    btnCancel->setIcon(QIcon("D:/QTProj/C++/icon/quxiao.png"));
    btnCancel->resize(100,50);
    btnCancel->move(380,340);
}

Widget::~Widget()
{
    delete ui;
}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值