qt 实现登录界面

复制代码
#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()
{

}
相关推荐
凡人叶枫4 小时前
C++中输入、输出和文件操作详解(Linux实战版)| 从基础到项目落地,避坑指南
linux·服务器·c语言·开发语言·c++
CSDN_RTKLIB4 小时前
使用三方库头文件未使用导出符号情景
c++
rainbow68895 小时前
Linux文件描述符与重定向原理
c++
CodeSheep程序羊6 小时前
拼多多春节加班工资曝光,没几个敢给这个数的。
java·c语言·开发语言·c++·python·程序人生·职场和发展
编程小白20266 小时前
从 C++ 基础到效率翻倍:Qt 开发环境搭建与Windows 神级快捷键指南
开发语言·c++·windows·qt·学习
.小墨迹7 小时前
apollo学习之借道超车的速度规划
linux·c++·学习·算法·ubuntu
历程里程碑7 小时前
Linux20 : IO
linux·c语言·开发语言·数据结构·c++·算法
郝学胜-神的一滴7 小时前
深入浅出:使用Linux系统函数构建高性能TCP服务器
linux·服务器·开发语言·网络·c++·tcp/ip·程序人生
天若有情6737 小时前
【自研实战】轻量级ASCII字符串加密算法:从设计到落地(防查岗神器版)
网络·c++·算法·安全·数据安全·加密
czy87874758 小时前
深入了解 C++ 中的 `std::bind` 函数
开发语言·c++