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()
{

}
相关推荐
蓝色汪洋14 小时前
经典修路问题
开发语言·c++·算法
DARLING Zero two♡15 小时前
接入 AI Ping 限免接口,让 GLM-4.7 与 MiniMax-M2.1 成为你的免费 C++ 审计专家
开发语言·c++·人工智能
零小陈上(shouhou6668889)15 小时前
YOLOv8+PyQt5输电线路缺陷检测(目前最全面的类别检测,可以从图像、视频和摄像头三种路径检测)
python·qt·yolo
程序喵大人15 小时前
constexpr
开发语言·c++·constexpr
Larry_Yanan15 小时前
Qt多进程(五)QUdpSocket
开发语言·c++·qt·学习·ui
冰西瓜60016 小时前
STL——vector
数据结构·c++·算法
闻缺陷则喜何志丹16 小时前
【离线查询 前缀和 二分查找 栈】P12271 [蓝桥杯 2024 国 Python B] 括号与字母|普及+
c++·算法·前缀和·蓝桥杯·二分查找··离线查询
ht巷子16 小时前
Qt:容器类的迭代
开发语言·c++·qt
chamu9917 小时前
关于编译-__declspec(dllexport)的使用场景
c++
QQ_43766431417 小时前
C++11并发编程
开发语言·c++