mywidget.cpp
#include "mywidget.h"
Mywidget::Mywidget(QWidget *parent)
: QMainWindow(parent)
{
this->setWindowTitle("qq");
this->setWindowIcon(QIcon("C:\\Users\\41220\\Desktop\\华清\\pictrue\\qq.png"));
this->setWindowFlag(Qt::FramelessWindowHint);
this->resize(400,560);
// this->setStyleSheet(" QMainWindow { background-image:url(:C:\\Users\\41220\\Desktop\\华清\\pictrue\\780.jpg)}');
this->setStyleSheet("background-color:white");
QLabel *lab1=new QLabel(this);
lab1->resize(400,160);
QMovie *mv =new QMovie("C:\\Users\\41220\\Desktop\\华清\\pictrue\\qq2.gif");
mv->setParent(this);
lab1->setMovie(mv);
mv->start();
lab1->setScaledContents(true);
QLabel *lab2 =new QLabel(this);
lab2->resize(35,35);
lab2->move(50,220);
lab2->setPixmap(( QPixmap("C:\\Users\\41220\\Desktop\\华清\\pictrue\\wodepeizhenshi.png")));
lab2->setScaledContents(true);
QLabel *lab3 =new QLabel(this);
lab3->resize(35,35);
lab3->move(50,265);
lab3->setPixmap(( QPixmap("C:\\Users\\41220\\Desktop\\华清\\pictrue\\passwd.jpg")));
lab3->setScaledContents(true);
//
QLineEdit *edit1= new QLineEdit(this);
edit1->move(90,220);
edit1->resize(320,50);
edit1->setPlaceholderText("qq/手机号/邮箱");
QLineEdit *edit2=new QLineEdit(this);
edit2->move(90,265);
edit2->resize(320,50);
edit2->setPlaceholderText("密码");
edit2->setEchoMode(QLineEdit::Password);
QPushButton *btn = new QPushButton("登录",this);
btn->move(50,400);
btn->resize(320,50);
btn->setStyleSheet("background-color:rgb(31,200,253);color:white;border-radius:10px");
}
Mywidget::~Mywidget()
{
}
mywidget.h
#ifndef MYWIDGET_H
#define MYWIDGET_H
#include <QMainWindow>
#include<QLabel>
#include<QMovie>
#include<QLineEdit>
#include<QPushButton>