#include "mainwidget.h"
MainWidget::MainWidget(QWidget *parent)
: QWidget(parent)
{
this->setWindowTitle("有道筆記");
this->setWindowIcon(QIcon("C:\\Users\\18801\\Desktop\\ydIcon\\icon"));
// this->setStyleSheet("background-color:white;border-radius:10px");
this->setStyleSheet("background-color:white;border-radius:10px");
this->resize(788,1243);
this->setFixedSize(788,1243);
this->setWindowFlag(Qt::FramelessWindowHint);//隱藏表頭
QLabel * lab1 = new QLabel(this);
lab1->resize(150,150);
lab1->move(638,5);
// lab1->setStyleSheet("background-color:red");
lab1->setPixmap(QPixmap("C:\\Users\\18801\\Desktop\\ydIcon\\right_top.png"));
lab1->setScaledContents(true);//圖片自適應
QLabel * lab2 = new QLabel(this);
lab2->resize(230,230);
lab2->move(269,65);
// lab2->setStyleSheet("background-color:red");
lab2->setPixmap(QPixmap("C:\\Users\\18801\\Desktop\\ydIcon\\logo.png"));
lab2->setScaledContents(true);//圖片自適應
QLineEdit * edit1 = new QLineEdit(this);
edit1->setPlaceholderText(" 請輸入郵箱賬號");
edit1->setStyleSheet("barder-radius:10px;border: 1px solid gray;");
edit1->resize(630,70);
edit1->move(75,365);
edit1->setMaxLength(18);
QLineEdit * edit2 = new QLineEdit(this);
edit2->setPlaceholderText(" 請輸入郵箱密碼");
edit2->setStyleSheet("barder-radius:10px;border: 1px solid gray;");
edit2->resize(630,70);
edit2->move(75,465);
edit2->setMaxLength(18);
edit2->setEchoMode(QLineEdit::Password);
QPushButton * btn1 = new QPushButton(this);
btn1->setText("登錄");
btn1->setStyleSheet("background-color:rgb(101,136,246);border-radius:10px;color:white");
btn1->resize(630,70);
btn1->move(75,665);
QPushButton * btn2 = new QPushButton(this);
btn2->setText("手機號登錄");
btn2->setStyleSheet("background-color:rgb(241,243,245);border-radius:10px;");
btn2->resize(630,70);
btn2->move(75,775);
QLabel * lab3 = new QLabel(this);
lab3->resize(666,294);
lab3->move(70,926);
// lab2->setStyleSheet("background-color:red");
lab3->setPixmap(QPixmap("C:\\Users\\18801\\Desktop\\ydIcon\\bottom.png"));
lab3->setScaledContents(true);//圖片自適應
}
MainWidget::~MainWidget()
{
}
?文章來源地址http://www.zghlxwxcb.cn/news/detail-817770.html文章來源:http://www.zghlxwxcb.cn/news/detail-817770.html
?
到了這里,關(guān)于qt 實現(xiàn)登錄界面的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!