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()
{
}
相关推荐
Sammyyyyy1 分钟前
DeepSeek v3.2 正式发布,对标 GPT-5
开发语言·人工智能·gpt·算法·servbay
Luna-player10 分钟前
在前端中,<a> 标签的 href=“javascript:;“ 这个是什么意思
开发语言·前端·javascript
小草cys24 分钟前
项目7-七彩天气app任务7.4.2“关于”弹窗
开发语言·前端·javascript
小鸡吃米…34 分钟前
Python PyQt6教程三-菜单与工具栏
开发语言·python
aini_lovee1 小时前
寻找 MAC 协议的 MATLAB 仿真
开发语言·macos·matlab
Jelena157795857921 小时前
Java爬虫淘宝拍立淘item_search_img拍接口示例代码
开发语言·python
郝学胜-神的一滴1 小时前
Python数据模型:深入解析及其对Python生态的影响
开发语言·网络·python·程序人生·性能优化
一水鉴天2 小时前
整体设计 定稿 之26 重构和改造现有程序结构 之2 (codebuddy)
开发语言·人工智能·重构·架构
star _chen2 小时前
C++ std::move()详解:从小白到高手
开发语言·c++
lzhdim2 小时前
C#开发者必知的100个黑科技(前50)!从主构造函数到源生成器全面掌握
开发语言·科技·c#