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 小时前
c++ qt课设定制
开发语言·c++
charlie1145141912 小时前
嵌入式C++工程实践第16篇:第四次重构 —— LED模板,从通用GPIO到专用抽象
c语言·开发语言·c++·驱动开发·嵌入式硬件·重构
handler012 小时前
Linux: 基本指令知识点(2)
linux·服务器·c语言·c++·笔记·学习
小小码农Come on3 小时前
WorkerScript处理qml多线程处理异步数据
qt
小灰灰搞电子4 小时前
Qt 中的队列解析
qt
香蕉鼠片4 小时前
MFC是什么
c++·mfc
心态与习惯4 小时前
Julia 初探,及与 C++,Java,Python 的比较
java·c++·python·julia·比较
小欣加油5 小时前
leetcode2078 两栋颜色不同且距离最远的房子
数据结构·c++·算法·leetcode·职场和发展
我真不是小鱼5 小时前
cpp刷题打卡记录30——轮转数组 & 螺旋矩阵 & 搜索二维矩阵II
数据结构·c++·算法·leetcode
南境十里·墨染春水5 小时前
C++ 笔记 thread
java·开发语言·c++·笔记·学习