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

}
相关推荐
烦躁的大鼻嘎10 小时前
【Linux】深入探索多线程编程:从互斥锁到高性能线程池实战
linux·运维·服务器·开发语言·c++·算法·ubuntu
Wins_calculator11 小时前
C++编程的救赎:从反人性的编译到极速Vim工作流
c++·vim·wsl
深思慎考11 小时前
LinuxC++——etcd-cpp-api精简源代码函数参数查询参考
linux·c++·etcd
AI+程序员在路上11 小时前
QT6中QGraphicsView功能与应用
开发语言·c++·qt
stolentime11 小时前
二维凸包——Andrew 算法学习笔记
c++·笔记·学习·算法·计算几何·凸包
Q741_14711 小时前
C++ 位运算 高频面试考点 力扣 371. 两整数之和 题解 每日一题
c++·算法·leetcode·面试·位运算
aramae11 小时前
链表理论基础
数据结构·c++·算法·leetcode·链表
charlie11451419112 小时前
精读 C++20 设计模式:行为型设计模式 — 状态机模式
c++·学习·设计模式·状态模式·c++20
liuyao_xianhui12 小时前
四数之和_优选算法(C++)双指针法总结
java·开发语言·c++·算法·leetcode·职场和发展
CAir213 小时前
CGO 原理
c++·go·cgo