C++模仿qq界面

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

MyWidget::MyWidget(QWidget *parent)
    : QWidget(parent)
{
    //设置窗口的大小
    this->resize(645,497);
    //设置窗口名字
    this->setWindowTitle("QQ");
    //设置窗口图标
    this->setWindowIcon(QIcon("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\qq.png"));
    //设置背景颜色
    this->setStyleSheet("Background-color:rgb(255,255,255)");

    //设置标签动图
    QLabel *lab1 = new QLabel(this);
    lab1->resize(645,190);
    //接收动图类
    QMovie *mv1= new QMovie("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\zz.gif");
    lab1->setMovie(mv1);
    mv1->start();
    //自适应
    lab1->setScaledContents(true);

    //设置标签qq
    QLabel *lab2 = new QLabel(this);
    lab2->resize(25,32);
    lab2->move(150,265);
    lab2->setPixmap(QPixmap("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\qqe.png"));
    lab2->setScaledContents(true);
    //设置标签锁
    QLabel *lab3 = new QLabel(this);
    lab3->resize(25,32);
    lab3->move(150,323);
    lab3->setPixmap(QPixmap("C:\\zhouzhouMyfile\\qt_project\\qt\\day1\\pictrue\\suo.png"));
    lab2->setScaledContents(true);

    //设置标签文本"QQ号码/手机/邮箱"
    QLineEdit *edit1 = new QLineEdit(this);
    edit1->resize(310,45);
    edit1->move(175,265);
    edit1->setPlaceholderText("QQ号码/手机/邮箱");
    //设置标签文本密码
    QLineEdit *edit2 = new QLineEdit(this);
    edit2->resize(310,45);
    edit2->move(175,323);
    edit2->setPlaceholderText("密码");
    edit2->setEchoMode(QLineEdit::Password);

    //设置登陆按钮
    QPushButton *btn1 = new QPushButton("登录",this);
    btn1->resize(357,54);
    btn1->move(144,414);
    btn1->setStyleSheet("Background-color:rgb(7,188,252)");



}
相关推荐
我不是代码教父5 分钟前
[原创](Modern C++)现代C++的关键性概念: 流格式化
c++·字符串格式化·流格式化·cout格式化
利刃大大22 分钟前
【回溯+剪枝】找出所有子集的异或总和再求和 && 全排列Ⅱ
c++·算法·深度优先·剪枝
子燕若水40 分钟前
mac 手工安装OpenSSL 3.4.0
c++
*TQK*1 小时前
ZZNUOJ(C/C++)基础练习1041——1050(详解版)
c语言·c++·编程知识点
ElseWhereR1 小时前
C++ 写一个简单的加减法计算器
开发语言·c++·算法
*TQK*2 小时前
ZZNUOJ(C/C++)基础练习1031——1040(详解版)
c语言·c++·编程知识点
※DX3906※2 小时前
cpp实战项目—string类的模拟实现
开发语言·c++
萌の鱼3 小时前
leetcode 2080. 区间内查询数字的频率
数据结构·c++·算法·leetcode
xianwu5434 小时前
反向代理模块jmh
开发语言·网络·数据库·c++·mysql
敖行客 Allthinker6 小时前
从 UTC 日期时间字符串获取 Unix 时间戳:C 和 C++ 中的挑战与解决方案
linux·运维·服务器·c++