QTDAY1

QTDAY1_第1张图片

 

 

 

#include "widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    //设置窗口固定尺寸
     this->setFixedSize(480,430);

    //窗口标题
    this->setWindowTitle("耗子尾汁");
    this->setWindowIcon(QIcon("C:\\Users\\PC\\Desktop\\my_icon.png"));

    //设置透明度
    this->setWindowOpacity(0.9);

    //构造logo标签
    movie1 = new QMovie("C:\\Users\\PC\\Desktop\\111.gif");
    lab1 = new QLabel(this);
    lab1->resize(480,200);
    lab1->move(0,0);
    lab1->setMovie(movie1);
    movie1->start();
    lab1->setScaledContents(true);

    //构造用户标签
    lab2 = new QLabel(this);
    lab2->resize(30,30);
    lab2->move(100,250);
    lab2->setPixmap(QPixmap("C:\\Users\\PC\\Desktop\\denglu.png"));
    lab2->setScaledContents(true);

    //构造密码标签
    lab3 = new QLabel(this);
    lab3->resize(30,30);
    lab3->move(100,300);
    lab3->setPixmap(QPixmap("C:\\Users\\PC\\Desktop\\denglumima.png"));
    lab3->setScaledContents(true);

    //构造用户名行编辑
    edit1 = new QLineEdit(this);
    edit1->resize(200,30);
    edit1->move(150,250);
    edit1->setPlaceholderText("用户名");
    edit1->setStyleSheet("border:none;"
                         "border-bottom: 2px solid skyblue;");

    //构造密码行编辑
    edit2 = new QLineEdit(this);
    edit2->move(150,300);
    edit2->resize(edit1->size());
    edit2->clear();
    edit2->setEchoMode(QLineEdit::Password);
    edit2->setPlaceholderText("密码");
    edit2->setStyleSheet("border:none;"
                         "border-bottom: 2px solid skyblue;");

    //构造登录按钮
    btn1 = new QPushButton(QIcon("C:\\Users\\PC\\Desktop\\denglu_1.png"),"登录",this);
    btn1->resize(80,30);
    btn1->move(200,360);
    btn1->setStyleSheet("background-color:skyblue; border-radius:10px;");

    //构造取消按钮
    btn2 = new QPushButton(QIcon("C:\\Users\\PC\\Desktop\\quxiao.png"),"取消",this);
    btn2->resize(80,30);
    btn2->move(300,360);
    btn2->setStyleSheet("background-color:skyblue; border-radius:10px;");

}

Widget::~Widget()
{
}

QTDAY1_第2张图片

 

你可能感兴趣的:(javascript,开发语言,ecmascript)