qtday1

#include "firstqt.h"
#include "ui_firstqt.h"

firstqt::firstqt(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::firstqt)
{
    ui->setupUi(this);
    this->setFixedSize(488,300);
    this->setWindowTitle("快聊");
    this->setWindowIcon(QIcon("D:/qt/icon/wodepeizhenshi.png"));
    QLabel *lab1=new QLabel(this);
    lab1->setPixmap(QPixmap("D:/qt/icon/logo.png"));
    lab1->setGeometry(0,0,488,130);
    QLabel *lab2=new QLabel(this);
    lab2->setGeometry(120,150,30,30);
    lab2->setPixmap(QPixmap("D:/qt/icon/userName.jpg"));
    lab2->setScaledContents(true);
    QLabel *lab3=new QLabel(this);
    lab3->resize(30,30);
    lab3->move(lab2->x(),lab2->y()+60);
    lab3->setPixmap(QPixmap("D:/qt/icon/passwd.jpg"));
    lab3->setScaledContents(true);
    QLineEdit *edit1=new QLineEdit(this);
    edit1->resize(200,30);
    edit1->move(lab2->x()+60,lab2->y());
    edit1->setPlaceholderText("qq号码/手机/邮箱");
    QLineEdit *edit2=new QLineEdit(this);
    edit2->resize(200,30);
    edit2->move(lab3->x()+60,lab3->y());
    edit2->setPlaceholderText("密码");
    QPushButton *btn1=new QPushButton("登录",this);
    btn1->resize(QSize(50,30));
    btn1->move(200,250);
    btn1->setIcon(QIcon("D:/qt/icon/login.png"));
    QPushButton *btn2=new QPushButton("取消",this);
    btn2->resize(QSize(50,30));
    btn2->move(btn1->x()+60,btn1->y());
    btn2->setIcon(QIcon("D:/qt/icon/cancel.png"));


}

firstqt::~firstqt()
{
    delete ui;
}

qtday1_第1张图片qtday1_第2张图片

你可能感兴趣的:(qt)