2024-09-06作业

结果对比

代码

#include "mywidget.h"
 
MyWidget::MyWidget(QWidget *parent)
    : QWidget(parent)
{
    this->setWindowIcon(QIcon("C:\\Users\\86156\\Desktop\\p\\4.jpg"));
    this->resize(1080,610);//设置窗口大小
    this->setFixedSize(1080,610);//固定窗口大小
    this->setStyleSheet("background-color:black");//设置背景颜色
    this->setWindowFlag(Qt::FramelessWindowHint);//隐藏头部
 
    QPushButton *btn1=new QPushButton;
    btn1->setParent(this);
    btn1->setText("登录");
    btn1->setStyleSheet("background-color:rgb(255,128,52)");
    btn1->resize(245,50);
    btn1->move(418,484);
 
    QLineEdit *edit1=new QLineEdit(this);
    edit1->resize(245,43);
    edit1->move(418,393);
    edit1->setPlaceholderText("请输入密码");
    edit1->setStyleSheet("background-color:white");
    edit1->setEchoMode(QLineEdit::Password);//密码
    QLineEdit *edit0=new QLineEdit(this);
    edit0->setPlaceholderText("请输入QQ号码");
    edit0->setStyleSheet("background-color:white");
    edit0->resize(245,43);
    edit0->move(418,340);
    QLineEdit *edit2=new QLineEdit("保存账号",this);
    edit2->setStyleSheet("background-color:white");
    edit2->resize(70,20);
    edit2->move(448,445);
    QLineEdit *edit3=new QLineEdit("",this);
    edit3->setStyleSheet("background-color:white");
    edit3->resize(20,20);
    edit3->move(418,445);
 
    QLabel *lab=new QLabel(this);
    //lab->move(200,200);
    lab->resize(341,610);
    lab->setPixmap(QPixmap("C:\\Users\\86156\\Desktop\\p\\1.jpg"));
    lab->setScaledContents(true);
    //lab ->setStyleSheet("background-color:white");
    QLabel *lab1=new QLabel(this);
    lab1->move(739,0);
    lab1->resize(341,610);
    lab1->setScaledContents(true);
    lab1->setPixmap(QPixmap("C:\\Users\\86156\\Desktop\\p\\2.jpg"));
    //lab1 ->setStyleSheet("background-color:white");
 
    QLabel *lab2=new QLabel(this);//图标
    lab2->move(477,100);
    lab2->resize(100,110);
    lab2->setPixmap(QPixmap("C:\\Users\\86156\\Desktop\\p\\4.jpg"));
    //lab1 ->setStyleSheet("background-color:white");
 
    QLabel *lab6=new QLabel(this);
    lab6->move(458,230);
    lab6->resize(150,100);
    lab6->setScaledContents(true);
    lab6->setPixmap(QPixmap("C:\\Users\\86156\\Desktop\\p\\6.jpg"));
 
}
 
MyWidget::~MyWidget()
{
}
 
 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值