用QT编写QQ登陆界面

用QT编写QQ登陆界面_第1张图片

用QT编写QQ登陆界面_第2张图片

 

#include "mywindow.h"

MyWindow::MyWindow(QWidget *parent)
    : QMainWindow(parent)
{

    //设置窗口最大尺寸
    this->setMaximumSize(1000,800);
    //设置窗口最小尺寸
    this->setMinimumSize(1000,800);
    //设置窗口固定尺寸
    this->setFixedSize(500,350);


    //输出窗口名称
    qDebug()<windowTitle();
    //设置窗口名称
    this->setWindowTitle("QQ");
    //更改图标
    this->setWindowIcon(QIcon("/Users/dongjunyi/Desktop/QT/icon_nhgbq8i4bf/QQ.png"));
    //更改窗口透明度
    this->setWindowOpacity(0.9);
    //设置纯净窗口
    //this->setWindowFlag(Qt::FramelessWindowHint);
    QPushButton *btn1=new QPushButton("登陆",this);
    btn1->move(180,270);
    btn1->resize(70,20);
    QPushButton *btn2=new QPushButton("取消",this);
    btn2->move(270,270);
    btn2->resize(70,20);

    QLabel *lbtn=new QLabel("QQ",this);
    lbtn->resize(20,20);
    lbtn->move(20,0);
    QLineEdit *line1=new QLineEdit(this);
    QLineEdit *line2=new QLineEdit(this);
    line1->setEchoMode(QLineEdit::Password);
    line1->move(170,240);
    line1->resize(200,20);
    line2->move(170,210);
    line2->resize(200,20);
    line1->setPlaceholderText("密码");
    line2->setPlaceholderText("账号");
    QLabel *lbtn1=new QLabel(this);
    lbtn1->setScaledContents(true);
    lbtn1->setPixmap(QPixmap("/Users/dongjunyi/Desktop/QT/icon_nhgbq8i4bf/denglumima.png"));

    lbtn1->resize(20,20);
    lbtn1->move(150,240);
    QLabel *lbtn2=new QLabel("账号",this);
    lbtn2->setScaledContents(true);
    lbtn2->setPixmap(QPixmap("/Users/dongjunyi/Desktop/QT/icon_nhgbq8i4bf/QQ.png"));
    lbtn2->resize(20,20);
    lbtn2->move(150,210);
    QLabel *lbtn3=new QLabel(this);
    lbtn3->setScaledContents(true);
    lbtn3->setPixmap(QPixmap("/Users/dongjunyi/Desktop/QT/icon_nhgbq8i4bf/QQ.png"));
    lbtn3->resize(20,20);
    lbtn3->move(0,0);
    QLabel *lbtn4=new QLabel(this);
    lbtn4->setScaledContents(true);
    lbtn4->setPixmap(QPixmap("/Users/dongjunyi/Desktop/QT/icon_nhgbq8i4bf/38adca8ffbfa47cf91e2d5254bbe1049.jpeg"));
    lbtn4->resize(500,150);
    lbtn4->move(0,50);


}

MyWindow::~MyWindow()
{

}

你可能感兴趣的:(qt,开发语言)