QT/作业/2024/9/6

#include "mywidget.h"

myWidget::myWidget(QWidget *parent)
    : QWidget(parent)
{
    //============窗口设置==============
    this->setWhatsThis("用户");
    this->setWindowIcon(QIcon("E:\\浏览器下载\\pictrue\\wodepeizhenshi.png"));
    this->setWindowFlag(Qt::FramelessWindowHint);
    this->setStyleSheet("background-color:white");
    //设置窗口大小
    this->resize(990,685);
    //固定窗口大小
    this->setFixedSize(990,685);


    //===========谷歌按钮图标创建=========
    QPushButton *button1=new QPushButton;
    button1->setParent(this);
    button1->setIcon(QIcon("E:/浏览器下载/pictrue/D89B15BBDA57EEB3F78D30285ADB26C1.jpg"));
    button1->move(740,500);
    button1->resize(60,60);
    button1->setStyleSheet("QPushButton {"
                              "border-radius: 20px;" // 半径是按钮宽度的一半
                              "background-color: white;" // 背景色
                              "border: none;"
                              "color: white;"
                              "font-size: 16px;"
                              "}"
                              "QPushButton:hover {"
                              "background-color:rgb(247,247,247);" // 悬停时背景色
                              "}");
    //===========第二个按钮图标创建=========
    QPushButton *button2=new QPushButton;
    button2->setParent(this);
    button2->setIcon(QIcon("E:/浏览器下载/pictrue/173D65498430206B6E8A149E796A2049.jpg"));
    button2->move(660,500);
    button2->resize(60,60);
    button2->setStyleSheet("QPushButton {"
                              "border-radius: 20px;" // 半径是按钮宽度的一半
                              "background-color: white;" // 背景色
                              "border: none;"
                              "color: white;"
                              "font-size: 16px;"
                              "}"
                              "QPushButton:hover {"
                              "background-color:rgb(247,247,247);" // 悬停时背景色
                              "}");
    //===========第三个按钮图标创建=========
    QPushButton *button3=new QPushButton;
    button3->setParent(this);
    button3->setIcon(QIcon("E:/浏览器下载/pictrue/5D30339FCBAE519BE6DD9D725063E504.jpg"));
    button3->move(820,500);
    button3->resize(60,60);
    button3->setStyleSheet("QPushButton {"
                              "border-radius: 20px;" // 半径是按钮宽度的一半
                              "background-color: white;" // 背景色
                              "border: none;"
                              "color: white;"
                              "font-size: 16px;"
                              "}"
                              "QPushButton:hover {"
                              "background-color:rgb(247,247,247);" // 悬停时背景色
                              "}");

    //===========标签相关的设置=========
    QLabel *label1=new QLabel(this);
    //设置大小
    label1->resize(530,685);
    //填充背景颜色
    label1->setStyleSheet("background-color:rgb(240,240,240)");
    //实例化动图对象
    QMovie *mv = new QMovie("E:/浏览器下载/pictrue/83E33959292CB63EA691D81BF12397C7.gif");
    //设置进标签中
    label1->setMovie(mv);
    //驱动图片
    mv->start();

    //===========行编辑器相关设置=========
    QLineEdit *edit1 =new QLineEdit(this);
    edit1->resize(300,46);
    edit1->move(620,212);
    edit1->setPlaceholderText("Email Address");

    QLineEdit *edit2 =new QLineEdit(this);
    edit2->resize(300,46);
    edit2->move(620,278);
    edit2->setPlaceholderText("Password");
}

myWidget::~myWidget()
{
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值