Qt 6.13

作业:

复制代码
#include "mywidget.h"

mywidget::mywidget(QWidget *parent)
    : QWidget(parent)
{
    this->setStyleSheet("background-color:white");
    this->resize(600,600);
    this->setWindowFlag(Qt::FramelessWindowHint);
    this->setWindowTitle("华清远见登录");



//    QLabel *lab1=new QLabel(this);
//    lab1->resize(95,55);
//    lab1->setStyleSheet("background-color:green");
//    lab1->setPixmap(QPixmap("C:\\Users\\ASUS\\Desktop\\微信图片_20240613194429.png"));

    QLabel *lab2=new QLabel(this);
    //lab2->move(100,100);
    lab2->resize(600,200);
   lab2->setStyleSheet("background-color:green");
    lab2->setPixmap(QPixmap("E:\\1.QQ\\1774024653\\FileRecv\\pictrue\\logo.png"));


//   QMovie *mov=new QMovie("‪‪C:\\Users\\ASUS\\Desktop\\zz.gif");
//    lab2->setMovie(mov);
//    mov->start();

   lab2->setScaledContents(true);

   QLineEdit *edit1=new QLineEdit(this);  //设置行编辑
   edit1->move(150,350);
   edit1->resize(300,30);
   edit1->setPlaceholderText("请输入账号名/注册");
   edit1->setEchoMode(QLineEdit::Normal);
   QLineEdit *edit2=new QLineEdit(this);
   edit2->move(150,390);
   edit2->resize(300,30);
   edit2->setPlaceholderText("密码");
    edit2->setEchoMode(QLineEdit::Password);

    QLabel *la1=new QLabel(this);
    la1->resize(30,30);
    la1->move(120,350);
    //la1->setStyleSheet("background-color:green");
    la1->setPixmap(QPixmap("‪E:\\1.QQ\\1774024653\\FileRecv\\pictrue\\login.png"));
    la1->setScaledContents(1);

    QPushButton *btn1=new QPushButton("登录",this);
    btn1->move(350,440);
    btn1->resize(100,30);
    btn1->setStyleSheet("background-color:pink");
    QPushButton *btn2=new QPushButton("取消",this);
    btn2->move(150,440);
    btn2->resize(100,30);
    btn2->setStyleSheet("background-color:yellow");



}

mywidget::~mywidget()
{
}
相关推荐
Sunshine for you7 分钟前
如何用FastAPI构建高性能的现代API
jvm·数据库·python
阿贵---11 分钟前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python
道清茗1 小时前
【MySQL知识点问答题】 MySQL 配置参数和内存管理
数据库·mysql
2401_884563241 小时前
进阶技巧与底层原理
jvm·数据库·python
2401_873204651 小时前
使用Pandas进行数据分析:从数据清洗到可视化
jvm·数据库·python
ZGi.ai1 小时前
生产级 Agent 编排 从单一 LLM 调用到多智能体工作流的工程设计
大数据·数据库·人工智能
superkcl20221 小时前
1. QObject(parent) 核心含义
数据库
微学AI1 小时前
树莓派搭建便携弱网测试网关:基于 Facebook ATC 的实践指南
数据库·内网穿透
小江的记录本1 小时前
【Bean】JavaBean(原生规范)/ Spring Bean 【重点】/ 企业级Bean(EJB/Jakarta Bean)
java·数据库·spring boot·后端·spring·spring cloud·mybatis
m0_662577971 小时前
自动化与脚本
jvm·数据库·python