1、QT思维导图
2、自由发挥应用场景,实现登录
#include "mywidget.h"
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
this->resize(642,493);
this->setFixedSize(642,493);
this->setWindowIcon(QIcon("D:/QTText/pictrue/qq.png"));
this->setStyleSheet("background-color:white");
this->setWindowFlag(Qt::FramelessWindowHint);
QLabel * lab1 = new QLabel(this);
lab1->resize(642,190);
lab1->setStyleSheet("background-color:pink");
QMovie *mv = new QMovie("D:/QTText/pictrue/qq.gif");
lab1->setMovie(mv);
mv->start();
lab1->setScaledContents(true);
QLabel *lab2 = new QLabel(this);
lab2->resize(24,35);
lab2->move(154,260);
lab2->setPixmap(QPixmap("D:\\QTText\\pictrue\\userName.jpg"));
lab2->setScaledContents(true);
QLabel *lab3 = new QLabel(this);
lab3->resize(24,35);
lab3->move(154,313);
lab3->setPixmap(QPixmap("D:\\QTText\\pictrue\\passwd.jpg"));
lab3->setScaledContents(true);
QLineEdit * edit1 = new QLineEdit(this);
edit1->resize(335,36);
edit1->move(180,260);
edit1->setPlaceholderText("QQ号/手机号/邮箱");
QLineEdit *edit2 = new QLineEdit(this);
edit2->resize(335,36);
edit2->move(180,313);
edit2->setPlaceholderText("密码");
edit2->setEchoMode(QLineEdit::Password);
QPushButton *btn = new QPushButton("登录",this);
btn->resize(360,45);
btn->move(154,410);
btn->setStyleSheet("background-color:rgb(8,189,253);border-radius:5px;color:white");
}
MyWidget::~MyWidget()
{
}