思维导图
设计一个登录界面
#include "mywidget.h"
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
this->setWindowFlag(Qt::FramelessWindowHint);
this->resize(700,550);
this->setWindowIcon(QIcon("D:/学校工作/截图/b1.jpg"));
/*********************************标签*********************************/
QLabel *lab1 = new QLabel;//标题
lab1->setParent(this);
lab1->setStyleSheet("background-color:rgb(100,179,236)");
lab1->setText("浇给聊天室");
lab1->move(50,0);
lab1->resize(650,50);
QLabel *lab2 = new QLabel;//log
lab2->setParent(this);
lab2->move(0,0);
lab2->resize(50,50);
lab2->setPixmap(QPixmap("D:/学校工作/截图/b1.jpg"));
lab2->setScaledContents(true);
QLabel *lab3 = new QLabel(this);
lab3->resize(700,500);
lab3->move(0,50);
QMovie *mv = new QMovie("D:/学校工作/截图/b2.gif");
mv->setParent(this);
lab3->setScaledContents(true);
mv->start();
lab3->setMovie(mv);
QLabel *lab4 = new QLabel(this);//账号小人
lab4->setPixmap(QPixmap("D:/学校工作/截图/a4.png"));
lab4->setScaledContents(true);
lab4->resize(50,50);
lab4->move(175,270);
QLabel *lab5 = new QLabel(this);//密码log
lab5->setPixmap(QPixmap("D:/学校工作/截图/a5.png"));
lab5->setScaledContents(true);
lab5->resize(50,50);
lab5->move(175,350);
/**********************************按钮*********************************************/
QPushButton *btn1 = new QPushButton("登录",this);//登录按钮
btn1->resize(200,50);
btn1->move(275,430);
btn1->setStyleSheet("background-color:rgb(225,225,225);border-radius:10px");
QPushButton *btn2 = new QPushButton("x",this);//关闭按钮
btn2->move(650,0);
btn2->resize(50,50);
btn2->setStyleSheet("background-color:rgb(100,179,236)");
QPushButton *btn3 = new QPushButton("-",this);//最小化按钮
btn3->resize(50,50);
btn3->move(600,0);
btn3->setStyleSheet("background-color:rgb(100,179,236);");
/******************************************行编辑器**********************************/
QLineEdit *edit1 = new QLineEdit();//账号输入
edit1->setPlaceholderText("账号");
edit1->setParent(this);
edit1->move(225,270);
edit1->resize(300,50);
QLineEdit *edit2 = new QLineEdit(this);//密码输入
edit2->move(225,350);
edit2->resize(300,50);
edit2->setPlaceholderText("密码");
edit2->setEchoMode(QLineEdit::Password);
}
MyWidget::~MyWidget()
{
}