#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//设置背景颜色
this->setStyleSheet("background-color:rgb(255,250,250)");
//重新设置窗口大小
this->resize(600,600);
//固定窗口大小
this->setFixedSize(800,800);
//创建一个标签
QLabel *l1 = new QLabel;
l1->setParent(this);
l1->resize(800,500);
//设置动图
QMovie *mv=new QMovie("C:\\Users\\10110\\Desktop\\pictrue\\82a8d3fd16b153d6.gif");
mv->setParent(this);
l1->setMovie(mv);
mv->start();
l1->setScaledContents(true);
//设置标签二
QLabel *l2=new QLabel("账户",this);
l2->setStyleSheet("background-color:rgb(3,187,250)");
l2->move(250,600);
l2->resize(70,50);
//设置标签三
QLabel *l3=new QLabel("密码",this);
l3->setStyleSheet("background-color:rgb(3,187,250)");
l3->move(250,660);
l3->resize(70,50);
//设置行编译器一 输入账户
QLineEdit *e2 = new QLineEdit(this);
e2->setStyleSheet("background-color:rgb(250,250,250)");
e2->move(320,600);
e2->resize(130,50);
//设置行编译器二 输入密码
QLineEdit *e1 =new QLineEdit(this);
e1->setEchoMode(QLineEdit::Password);
e1->setStyleSheet("background-color:rgb(250,250,250)");
e1->move(320,660);
e1->resize(130,50);
//实例化一个按钮
QPushButton *btn1 =new QPushButton;
btn1->setParent(this);
btn1->setText("寻找鸡哥");
btn1->setStyleSheet("background-color:rgb(3,187,250)");
btn1->resize(130,50);
btn1->move(320,730);
//设置菜单栏
QMenuBar *mb = menuBar();
this->setMenuBar(mb);
QMenu *file = mb->addMenu("文件");
file->addAction("新建");
file->addSeparator();
file->addAction("打开");
//设置工具栏
QToolBar *tbar=new QToolBar(this);
this->addToolBar(Qt::LeftToolBarArea,tbar);
tbar->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
tbar->setFloatable(false);
tbar->addAction("欢迎");
QPushButton *btn = new QPushButton(this);
btn->setText("编写");
tbar->addWidget(btn);
}