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()
{
}
相关推荐
maineKit15 分钟前
VS Code 搭建 Qt 6 开发环境保姆级教程:CMake / qmake、MSVC / MinGW 四种组合全覆盖
qt
知识分享小能手44 分钟前
Flask入门学习教程,从入门到精通,数据库操作 — 知识点详解与案例代码(4)
数据库·学习·flask
我是一颗柠檬1 小时前
【MySQL全面教学】MySQL基础SQL语句Day3(2026年)
数据库·后端·sql·mysql·oracle
XS0301061 小时前
MyBatis动态SQL
数据库·sql·mybatis
MandalaO_O1 小时前
MyBatis 与 MySQL 执行流程
数据库·mysql·mybatis
ai安歌2 小时前
鸿蒙PC:Qt适配OpenHarmony实战【取色间】:RGB 滑动调整、HEX 展示和颜色预览
qt·华为·harmonyos
l1t2 小时前
DeepSeek总结的将 Rust Delta Kernel 集成到 ClickHouse
数据库·clickhouse·rust
qq_283720052 小时前
万字深度:Chroma 向量数据库全解析 — 核心原理、实战操作、性能优化与工程最佳实践
数据库·性能优化
黄筱筱筱筱筱筱筱3 小时前
二进制包安装MySql服务
数据库
初心未改HD3 小时前
LLM应用开发之向量数据库详解
数据库·人工智能