#include "widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
//设置窗口
this->resize(428,330);
this->setWindowFlag(Qt::FramelessWindowHint);
//设置标签
QLabel *lab1 = new QLabel;
lab1->setParent(this);
lab1->resize(428,127);
lab1->setStyleSheet("background-color:green");
QLabel *lab2 = new QLabel;
lab2->setParent(this);
lab2->move(17,19);
lab2->resize(23,32);
lab2->setScaledContents(true);
lab2->setPixmap(QPixmap("D:\\QT\\OIP-C.png"));
QLabel *lab3 = new QLabel;
lab3->setParent(this);
lab3->move(41,18);
lab3->resize(37,22);
lab2->setPixmap(QPixmap("D:\\QT\\QT_sucaih1\\qq1.png"));
lab3->setScaledContents(true);
QLabel *lab4 = new QLabel;
lab4->setParent(this);
lab4->move(192,80);
lab4->resize(70,70);
lab4->setPixmap(QPixmap("D:\\QT\\QT_sucaih1\\153744-fcdlum43rt.webp"));
QLabel *lab5 = new QLabel;
lab5->setParent(this);
lab5->move(120,176);
lab5->resize(15,16);
lab5->setPixmap(QPixmap("D:\\QT\\QT_sucaih1\\qq1.png"));
lab5->setScaledContents(true);
QLabel *lab6 = new QLabel;
lab6->setParent(this);
lab6->move(120,209);
lab6->resize(17,18);
lab6->setPixmap(QPixmap("D:\\QT\\QT_sucaih1\\OIP-C.jpg"));
lab6->setScaledContents(true);
//设置行编辑
QLineEdit *ed1=new QLineEdit;
ed1->setParent(this);
ed1->move(150,175);
ed1->setPlaceholderText("qq号码/手机/邮箱");
QLineEdit *ed2=new QLineEdit;
ed2->setParent(this);
ed2->move(150,209);
ed1->setPlaceholderText("密码");
ed2->setEchoMode(QLineEdit::Password);
//按钮
QPushButton *btn1 = new QPushButton(this);
btn1->setText("登录");
btn1->setStyleSheet("background-color:blue");
btn1->move(120,277);
btn1->resize(220,35);
QPushButton *btn2 = new QPushButton(this);
btn2->setText("口自动登录");
btn2->setStyleSheet("background-color:white");
btn2->move(100,247);
btn2->resize(70,16);
btn2->setEnabled(false);
QPushButton *btn3 = new QPushButton(this);
btn3->setText("口记住密码");
btn3->setStyleSheet("background-color:white");
btn3->move(196,247);
btn3->resize(70,16);
btn3->setEnabled(false);
QPushButton *btn4 = new QPushButton(this);
btn4->setText("找回密码");
btn4->setStyleSheet("background-color:white");
btn4->move(289,247);
btn4->resize(70,16);
btn4->setEnabled(false);
}
10.16QT作业
最新推荐文章于 2024-08-03 20:45:09 发布