10.16 qt作业

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

QQWidget::QQWidget(QWidget *parent)
    : QWidget(parent)
{
    /* 窗口相关设置 */
    this->setWindowTitle("QQ");/* 自定义窗口标题 */
    this->setWindowIcon(QIcon("D:\\HQYJ\\C++&QT\\pictrue\\qq.png"));/* 设置窗口图标 */
    this->resize(644,492);
    //this->setWindowFlag(Qt::FramelessWindowHint);/* 纯净模式 隐藏窗口头部 */
    this->setStyleSheet("background-color:white;border-radius:5;border-width:3");


    /* label标签 */
    /* 动图 */
    QLabel *label1 = new QLabel(this);
    QMovie *mv = new QMovie("C:\\Users\\99689\\Pictures\\Saved Pictures\\3.gif");
    mv->start();
    label1->resize(642,190);
    label1->setMovie(mv);
    label1->setScaledContents(true);

    /* 头像 */
    QLabel *label3 = new QLabel(this);
    label3->setPixmap(QPixmap("C:\\Users\\99689\\Pictures\\Saved Pictures\\cat.png"));
    label3->setScaledContents(true);
    label3->move(270,135);
    label3->resize(100,100);

    /* qq号输入框前的图标 */
    QLabel *label4 = new QLabel(this);
    label4->setPixmap(QPixmap("C:\\Users\\99689\\Pictures\\Saved Pictures\\1.png"));
    label4->setScaledContents(true);
    label4->move(143,263);
    label4->resize(25,28);

    /* 密码输入框前的图标 */
    QLabel *label5 = new QLabel(this);
    label5->setPixmap(QPixmap("C:\\Users\\99689\\Pictures\\Saved Pictures\\2.png"));
    label5->setScaledContents(true);
    label5->move(143,320);
    label5->resize(25,28);

    /* 左下角 注册账号 标签 */
    QLabel *label6 = new QLabel(this);
    label6->setText("注册账号");
    label6->move(20,455);
    label6->resize(75,21);
    label6->setStyleSheet("font-family:微软雅黑;color:rgb(150,150,150)");

    /* 右下角 二维码 图标 */
    QLabel *label7 = new QLabel(this);//
    label7->setPixmap(QPixmap("C:\\Users\\99689\\Pictures\\Saved Pictures\\5.png"));
    label7->setScaledContents(true);
    label7->move(150,370);
    label7->resize(360,25);

    /* 密码输入框下的一排文字标签 */
    QLabel *label8 = new QLabel(this);
    label8->setPixmap(QPixmap("C:\\Users\\99689\\Pictures\\Saved Pictures\\4.png"));
    label8->setScaledContents(true);/* 图片自适应标签 */
    label8->move(592,442);
    label8->resize(35,35);

    /* 行编辑器 */
    /* qq号输入框 */
    QLineEdit *edit1 = new QLineEdit(this);
    edit1->setPlaceholderText("QQ号码/手机/邮箱");
    edit1->move(180,255);
    edit1->resize(337,48);
    edit1->setStyleSheet("font-family:微软雅黑;color:rgb(120,120,120)");

    /* 密码输入框 */
    QLineEdit *edit2 = new QLineEdit(this);
    edit2->setPlaceholderText("密码");
    edit2->move(180,310);
    edit2->resize(337,48);
    edit2->setEchoMode(QLineEdit::Password);/* 以密码方式显示 */
    edit2->setStyleSheet("font-family:微软雅黑;color:rgb(120,120,120)");

    /* 登录按钮 */
    QPushButton *button1 = new QPushButton("&登录",this);
    button1->move(150,405);
    button1->resize(370,50);
    button1->setStyleSheet("font-family:微软雅黑;background-color:rgb(112,201,253);color:white;border-radius:5;border-width:8");

}

QQWidget::~QQWidget()
{
}
相关推荐
听风吹等浪起5 小时前
第26章:ViT+InceptionDW+FocalLoss改进|CT骨折影像二分类完整Pytorch实现(含PyQt5推理GUI)
pytorch·qt·分类
ShineWinsu6 小时前
对于Qt:QRadioButton常见属性以及QButtonGroup的解析
数据库·c++·qt·microsoft·gui·qradiobutton·qbuttongroup
sycmancia10 小时前
Qml——Image和AnimatedImage使用
qt
lhbweilai13 小时前
QT(了解各个控件和布局)上
数据库·qt
ShineWinsu19 小时前
对于Qt:QLabel常见属性的解析
c++·qt·面试·笔试·gui·标签·qlabel
小徐不徐说19 小时前
数据库存储基础:理解表结构、主键、事务与 BLOB
开发语言·数据库·c++·qt·程序设计
蓝祁子yoky1 天前
Qt学习日记 Day13:网络编程(一)-TCP基础与Socket实战
网络·qt·学习
飞浪纪元[FWC–FE]2 天前
从零到一键绿:Qt 5.14.2 + VS2019 开发环境搭建、Kit 套件配置与构建错误修复完全手册
开发语言·qt
ShineWinsu2 天前
对于Qt:QCheckBox常见属性的详细解析
c++·qt·面试·笔试·gui·qcheckbox·多选框
ShineWinsu2 天前
对于Qt:QPushButton常见属性的解析
开发语言·c++·qt·api·gui·按钮·qpushbutton