#include "mywidget.h"MyWidget::MyWidget(QWidget *parent): QWidget(parent)
{---------------------窗口设置----------------------this->setWindowTitle("南城贤子摄影工作室");//设置窗口标题this->setWindowIcon(QIcon("d:\\Pictures\\Camera Roll\\rr"));//设置窗口图标this->setWindowFlag(Qt::FramelessWindowHint);//设置纯净标题this->resize(540,415);//设置大小this->setStyleSheet("background-color:white");//设置背景颜色---------------------标签设置----------------------QLabel *bel1=new QLabel(this);//设置一个标签bel1->resize(540,415);//设置大小bel1->setStyleSheet("background-color:green");//设置背景颜色//实例化一个动图指针QMovie *mv=new QMovie("d:\\Pictures\\Camera Roll\\dd");bel1->setMovie(mv);//将动图设置到标签中mv->start();//动图动起来bel1->setScaledContents(true);//自适应大小QLabel *bel2=new QLabel(this);bel2->resize(30,30);bel2->move(125,210);bel2->setPixmap(QPixmap("d:\\Pictures\\Camera Roll\\oo"));bel2->setScaledContents(true);QLabel *bel3=new QLabel(this);bel3->resize(30,30);bel3->move(125,260);bel3->setPixmap(QPixmap("d:\\Pictures\\Camera Roll\\passwd"));bel3->setScaledContents(true);--------------------行编辑器设置-------------------QLineEdit *dit1=new QLineEdit(this);//构造一个行编辑器dit1->move(160,210);dit1->resize(280,30);dit1->setPlaceholderText("QQ号码/手机/邮箱");//设置占位QLineEdit *dit2=new QLineEdit(this);//构造一个行编辑器dit2->move(160,260);dit2->resize(280,30);dit2->setPlaceholderText("密码");//设置占位dit2->setEchoMode(QLineEdit::Password);--------------------按钮设置-------------------QPushButton *btn=new QPushButton("登录",this);btn->move(125,345);btn->resize(300,45);//设置按钮大小btn->setStyleSheet("background-color:rgb(8,189,253);border-radius:5px;color:white");//设置背景,按钮样式,字体颜色}MyWidget::~MyWidget()
{
}