QT day1

MyWidget::MyWidget(QWidget *parent)
    : QWidget(parent)
{
    this->resize(536,412);
    this->setWindowTitle("QQ");
    this->setWindowIcon(QIcon("E:\\qq ls\\pictrue\\pictrue\\qq.png"));
    this->setStyleSheet("background-color:white");
    //this->setWindowFlag(Qt::FramelessWindowHint);



    QMovie *mv = new QMovie(this);
    mv->setFileName("E:\\qq ls\\pictrue\\pictrue\\qq2.gif");
    mv->start();

    QLabel *lab2 = new QLabel(this);
    lab2->resize(536,220);
    lab2->setMovie(mv);
    lab2->setScaledContents(true);

    QLabel *lab1 = new QLabel(this);
    lab1->resize(30,30);
    lab1->move(15,10);
    lab1->setPixmap(QPixmap("E:\\qq ls\\pictrue\\pictrue\\6.png"));
    lab1->setStyleSheet("background-color:transparent");
    lab1->setScaledContents(true);

      QLabel *lab3 =new QLabel(this);
      lab3->move(120,220);
      lab3->setPixmap(QPixmap("E:\\qq ls\\pictrue\\pictrue\\4.png"));
      lab3->setScaledContents(true);

      QLabel *lab4 =new QLabel(this);
      lab4->move(120,260);
      lab4->setPixmap(QPixmap("E:\\qq ls\\pictrue\\pictrue\\5.png"));
      lab4->setScaledContents(true);

      QLineEdit *ed1 = new QLineEdit(this);
      ed1->move(160,220);
      ed1->resize(230,30);
      ed1->setPlaceholderText("账号");

      QLineEdit *ed2 = new QLineEdit(this);
      ed2->move(160,260);
      ed2->resize(230,30);
      ed2->setPlaceholderText("密码");
      ed2->setEchoMode(QLineEdit::Password);

      QPushButton *btn = new QPushButton("登 录",this);
      btn->move(140,330);
      btn->resize(250,50);
      btn->setStyleSheet("background-color:rgb(0,190,255);border-radius:10px;color:white");

      QMovie *mv1 =new QMovie(this);
      mv1->setFileName("E:\\qq ls\\pictrue\\pictrue\\7.gif");
      mv1->start();

      QLabel *lab5 = new QLabel(this);
      lab5->resize(99,87);
      lab5->move(220,100);
      lab5->setMovie(mv1);
      lab5->setStyleSheet("border-radius:40");
      lab5->setScaledContents(true);

      QCheckBox *cb1 = new QCheckBox(this);
      cb1->resize(20,20);
      cb1->move(120,300);

      QLabel *lab6 =new QLabel("自动登录",this);
      lab6->resize(65,20);
      lab6->move(140,300);
      lab6->setStyleSheet("color:grey");

      QCheckBox *cb2 = new QCheckBox(this);
      cb2->resize(20,20);
      cb2->move(220,300);

      QLabel *lab7 =new QLabel("记住密码",this);
      lab7->resize(65,20);
      lab7->move(240,300);
      lab7->setStyleSheet("color:grey");

      QLabel *lab8 =new QLabel("找回密码",this);
      lab8->resize(65,20);
      lab8->move(335,300);
      lab8->setStyleSheet("background-color:transparent;color:grey");

      QLabel *lab9 =new QLabel("注册账号",this);
      lab9->resize(65,20);
      lab9->move(15,380);
      lab9->setStyleSheet("background-color:transparent;color:grey");

      QLabel *lab10 = new QLabel(this);
      lab10->resize(45,45);
      lab10->move(480,360);
      lab10->setPixmap(QPixmap("E:\\qq ls\\pictrue\\pictrue\\10.png"));
      lab10->setStyleSheet("background-color:transparent");
      lab10->setScaledContents(true);
}

QT day1_第1张图片

你可能感兴趣的:(qt)