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)");



}
相关推荐
蜉蝣之翼❉3 小时前
CRT 不同会导致 fopen 地址不同
c++·mfc
aramae4 小时前
C++ -- STL -- vector
开发语言·c++·笔记·后端·visual studio
lixzest4 小时前
C++ Lambda 表达式详解
服务器·开发语言·c++·算法
_Chipen5 小时前
C++基础问题
开发语言·c++
灿烂阳光g5 小时前
OpenGL 2. 着色器
c++·opengl
AA陈超6 小时前
虚幻引擎UE5专用服务器游戏开发-20 添加基础能力类与连招能力
c++·游戏·ue5·游戏引擎·虚幻
mit6.8247 小时前
[Meetily后端框架] AI摘要结构化 | `SummaryResponse`模型 | Pydantic库 | vs marshmallow库
c++·人工智能·后端
R-G-B7 小时前
【02】MFC入门到精通——MFC 手动添加创建新的对话框模板
c++·mfc·mfc 手动添加创建新的对话框
linux kernel7 小时前
第七讲:C++中的string类
开发语言·c++
Tipriest_7 小时前
[数据结构与算法] 优先队列 | 最小堆 C++
c++·优先队列·数据结构与算法·最小堆