0108作业

cpp 复制代码
#include "widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    this->setWindowTitle("腾讯会议");
    this->resize(470,800);//设置界面大小
    this->setFixedSize(470,800);//锁定界面大小
    this->setStyleSheet("background-color:white");//填充界面背景颜色
    this->setWindowFlag(Qt::FramelessWindowHint);//设置纯净窗口

    //标签的设置
    //创建标签
    QLabel *lab1=new QLabel(this);
    //设置标签1位置
    lab1->move(170,150);
    //设置标签1大小
    lab1->resize(130,80);
    //设置标签1背景
    lab1->setStyleSheet("background-color:white");
    //填充图片
    lab1->setPixmap(QPixmap("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\lab1.png"));
    //图片适应标签大小
    lab1->setScaledContents(true);
    //创建标签
    QLabel *lab2=new QLabel(this);
    //设置标签2位置
    lab2->move(170,230);
    //设置标签2大小
    lab2->resize(130,35);
    //设置标签2背景
    lab2->setStyleSheet("background-color:white");
    //填充图片
    lab2->setPixmap(QPixmap("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\lab2.png"));
    //图片适应标签大小
    lab2->setScaledContents(true);
    //创建标签
    QLabel *lab3=new QLabel(this);
    //设置标签3位置
    lab3->move(170,265);
    //设置标签3大小
    lab3->resize(130,20);
    //设置标签3背景
    lab3->setStyleSheet("background-color:white");
    //填充图片
    lab3->setPixmap(QPixmap("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\lab3.png"));
    //图片适应标签大小
    lab3->setScaledContents(true);
    //创建标签
    QLabel *lab4=new QLabel("其他登录方式",this);
    //设置标签4位置
    lab4->move(190,585);
    //设置标签4大小
    lab4->resize(95,15);
    //设置标签4背景
    lab4->setStyleSheet("background-color:white");
    //创建标签
    QLabel *lab5=new QLabel(this);
    //设置标签5位置
    lab5->move(200,25);
    //设置标签5大小
    lab5->resize(70,22);
    //设置标签5背景
    lab5->setStyleSheet("background-color:white");
    //填充图片
    lab5->setPixmap(QPixmap("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\lab5.png"));
    //图片适应标签大小
    lab5->setScaledContents(true);

    //按钮
    //创建按钮1
    QPushButton *p1=new QPushButton("手机号",this);
    //设置按钮1位置
    p1->move(64,635);
    //设置按钮1大小
    p1->resize(90,35);
    //设置按钮1图标
    p1->setIcon(QIcon("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\p1.png"));
    //设置按钮1背景颜色
    p1->setStyleSheet("background-color:white");
    //创建按钮2
    QPushButton *p2=new QPushButton("企业微信",this);
    //设置按钮2位置
    p2->move(158,635);
    //设置按钮2大小
    p2->resize(90,35);
    //设置按钮2图标
    p2->setIcon(QIcon("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\p2.png"));
    //设置按钮2背景颜色
    p2->setStyleSheet("background-color:white");
    //创建按钮3
    QPushButton *p3=new QPushButton("SSO",this);
    //设置按钮3位置
    p3->move(252,635);
    //设置按钮3大小
    p3->resize(90,35);
    //设置按钮3图标
    p3->setIcon(QIcon("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\p3.png"));
    //设置按钮3背景颜色
    p3->setStyleSheet("background-color:white");
    //创建按钮4
    QPushButton *p4=new QPushButton("邮箱",this);
    //设置按钮4位置
    p4->move(346,635);
    //设置按钮4大小
    p4->resize(90,35);
    //设置按钮4图标
    p4->setIcon(QIcon("C:\\Users\\20286\\Pictures\\Screenshots\\xiangmu\\p4.png"));
    //设置按钮4背景颜色
    p4->setStyleSheet("background-color:white");

    //行编辑器
    //创建行编辑器1
    QLineEdit *l1=new QLineEdit(this);
    //设置行编辑器1位置
    l1->move(94,500);
    //设置行编辑器1大小
    l1->resize(282,30);
    //设置行编辑器1占位
    l1->setPlaceholderText("账号");
    //设置行编辑器2
    QLineEdit *l2=new QLineEdit(this);
    //设置行编辑器2位置
    l2->move(94,530);
    //设置行编辑器2大小
    l2->resize(282,30);
    //设置行编辑器2占位
    l2->setPlaceholderText("密码");
    //设置行规编辑器2显示模式
    l2->setEchoMode(QLineEdit::Password);

}

Widget::~Widget()
{

}
相关推荐
小短腿的代码世界1 天前
Qt 股票订单撮合引擎:高频交易系统的核心心脏
开发语言·数据库·qt·系统架构·交互
REDcker1 天前
C++变量存储与ELF段布局详解 从const全局到rodata与nm_readelf验证实践
java·c++·面试
王老师青少年编程1 天前
csp信奥赛C++高频考点专项训练之字符串 --【字符串排序】:合并序列
c++·字符串·csp·高频考点·信奥赛·字符串排序·合并序列
handler011 天前
UDP协议与网络通信知识点
c语言·网络·c++·笔记·网络协议·udp
神仙别闹1 天前
基于QT(C++)实现学生成绩管理系统
数据库·c++·qt
君义_noip1 天前
CSP-S 2025 入门级 第一轮(初赛) 完善程序(1)
c++·算法·信息学奥赛·初赛·csp 第一轮
小短腿的代码世界1 天前
Qt OpenGL 架构与自定义着色器:源码级解析高性能图形渲染
qt·架构·着色器
蜡笔小马1 天前
07.C++设计模式-组合模式
c++·设计模式·组合模式
liulilittle1 天前
TCP UCP v1.0:BBR 的非破坏性约束层
网络·c++·网络协议·tcp/ip·算法·c·通信
每天回答3个问题1 天前
leetcodeHot100 | 104.二叉树的最大深度
c++·面试·