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()
{

}
相关推荐
fpcc9 分钟前
C++编程实践——链式调用的实践
c++
bkspiderx2 小时前
C++中的volatile:从原理到实践的全面解析
开发语言·c++·volatile
君义_noip4 小时前
信息学奥赛一本通 2134:【25CSPS提高组】道路修复 | 洛谷 P14362 [CSP-S 2025] 道路修复
c++·算法·图论·信息学奥赛·csp-s
liulilittle4 小时前
OPENPPP2 Code Analysis One
网络·c++·网络协议·信息与通信·通信
Morwit4 小时前
*【力扣hot100】 647. 回文子串
c++·算法·leetcode
天赐学c语言5 小时前
1.7 - 删除排序链表中的重要元素II && 哈希冲突常用解决冲突方法
数据结构·c++·链表·哈希算法·leecode
w陆压5 小时前
12.STL容器基础
c++·c++基础知识
龚礼鹏6 小时前
Android应用程序 c/c++ 崩溃排查流程二——AddressSanitizer工具使用
android·c语言·c++
qq_401700416 小时前
QT C++ 好看的连击动画组件
开发语言·c++·qt
额呃呃7 小时前
STL内存分配器
开发语言·c++