QT day1

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

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    this->setWindowTitle("QQ");
    this->setWindowIcon(QIcon("C:\\Users\\zr\\Desktop\\QT\\pictrue\\qq.png"));
    this->resize(540,410);
    this->setStyleSheet("background-color:white");
    this->setWindowFlag(Qt::FramelessWindowHint);


    QLabel *lab1 =new QLabel(this);
    lab1->resize(540,190);
    QMovie *mv = new QMovie("C:\\Users\\zr\\Desktop\\QT\\pictrue\\qq.gif");
    mv->setParent(this);
    lab1->setMovie(mv);
    mv->start();
    lab1->setScaledContents(true);

    QLabel *lab2 = new QLabel(this);
    lab2->move(120,220);
    lab2->resize(30,30);
    lab2->setPixmap(QPixmap("C:\\Users\\zr\\Desktop\\QT\\pictrue\\wodepeizhenshi.png"));
    lab2->setScaledContents(true);

    QLabel *lab3 = new QLabel(this);
    lab3->move(120,270);
    lab3->resize(30,30);
    lab3->setPixmap(QPixmap("C:\\Users\\zr\\Desktop\\QT\\pictrue\\passwd.jpg"));
    lab3->setScaledContents(true);




    QLineEdit *edit1 = new QLineEdit(this);
    edit1->move(155,220);
    edit1->resize(250,30);
    edit1->setPlaceholderText("账号/密码/电话");

    QLineEdit *edit2 = new QLineEdit(this);
    edit2->move(155,270);
    edit2->resize(250,30);
    edit2->setPlaceholderText("密码");
    edit2->setEchoMode(QLineEdit::Password);



    QPushButton *btn1 = new QPushButton("登录",this);
    btn1->resize(150,50);
    btn1->move(180,330);
    btn1->setStyleSheet("background-color:rgb(60,120,120);color:rgb(255,255,255);border-radius:10px");

}

Widget::~Widget()
{
}
相关推荐
CUMT_DJ1 小时前
matlab计算算法的运行时间
开发语言·算法·matlab
Overboom4 小时前
[C++] --- 常用设计模式
开发语言·c++·设计模式
Univin4 小时前
C++(10.4)
开发语言·数据结构·c++
YxVoyager4 小时前
Qt C++ :QLayout 布局管理
c++·qt
KyollBM4 小时前
每日羊题 (质数筛 + 数学 | 构造 + 位运算)
开发语言·c++·算法
Paul_09206 小时前
golang面经——map模块和sync.Map模块
开发语言
Univin6 小时前
C++(10.5)
开发语言·c++·算法
haogexiaole6 小时前
Java高并发常见架构、处理方式、api调优
java·开发语言·架构
张人玉7 小时前
C# 通讯关键类的API
开发语言·c#
froginwe117 小时前
R 数组:深入解析与高效使用
开发语言