华清远见第六课程day8作业

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QtDebug>
#include<iostream>
#include<QIcon>
#include<QPushButton>
#include<QLineEdit>
#include<QLabel>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
     this->setFixedSize(400,360);
    ui->setupUi(this);
    this->setWindowIcon(QIcon("E:\\QTproject\\day1\\day1hk\\hk\\icon\\1.png"));
//    this->setStyleSheet("background-color:rgb(222,222,222)");
    this->setWindowTitle("combat simulator");

    QPushButton *login = new QPushButton("login",this);
    login->resize(80,30);
    login->move(120,280);
    login->setIcon(QIcon("E:\\QTproject\\day1\\day1hk\\hk\\icon\\2.png"));


    QPushButton *cancel = new QPushButton("cancel",this);
    cancel->resize(login->size());
    cancel->move(login->x()+130,login->y());
    cancel->setIcon(QIcon("E:\\QTproject\\day1\\day1hk\\hk\\icon\\cancel.png"));

    QLineEdit *account= new QLineEdit(this);
    account->resize(200,30);
    account->move(login->x(), login->y()-120);
    account->setPlaceholderText("please enter your account");

    QLineEdit *password= new QLineEdit(this);
    password->resize(200,30);
    password->move(login->x(), login->y()-70);
    password->setPlaceholderText("please enter your password");

    QLabel *title = new QLabel(this);
    title->resize(400,150);
    title->setPixmap(QPixmap("E:\\QTproject\\day1\\day1hk\\hk\\title\\1.png"));

    QLabel *accounticon = new QLabel(this);
    accounticon->resize(30,30);
    accounticon->move(account->x()-40,account->y());
    accounticon->setPixmap(QPixmap("E:\\QTproject\\day1\\day1hk\\hk\\icon\\lock.png"));
    accounticon->setScaledContents(true);
    accounticon->setScaledContents(true);

    QLabel *passwordicon = new QLabel(this);
    passwordicon->resize(30,30);
    passwordicon->move(password->x()-40,password->y());
    passwordicon->setPixmap(QPixmap("E:\\QTproject\\day1\\day1hk\\hk\\icon\\lock glitch.png"));
    passwordicon->setScaledContents(true);
    passwordicon->setScaledContents(true);
}

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值