QT day2 组件

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>

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值