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()
{
}
相关推荐
Quz4 天前
QML Hello World 入门示例
qt
xcyxiner7 天前
DicomViewer (dcmtk读取dcm文件)5
qt
xcyxiner8 天前
DicomViewer (后台线程处理文件)4
qt
xcyxiner8 天前
DicomViewer (添加模型类)3
qt
xcyxiner9 天前
DicomViewer (目录调整) 2
qt
xcyxiner9 天前
dcmtk vtk vtk-dicom(gdcm) 编译(debug) v2
qt
桥田智能11 天前
桥田智能 QT-650S:面向白车身焊装的 800kg 重载快换解决方案
开发语言·qt·系统架构
森G11 天前
75、服务器源码解析---------云视频服务项目
linux·服务器·网络·c++·qt
森G11 天前
77、线程池原理和实现------服务器源码解析----云视频服务项目
服务器·c++·qt
森G11 天前
71、打包发布---------打包发布
c++·qt