8.30作业

news/2025/2/4 15:45:21/

QTc++登录界面

#include "widget.h"
#include<QIcon>
#include<QLineEdit>
#include<QLabel>
#include<QPushButton>
Widget::Widget(QWidget *parent): QWidget(parent)
{this->setFixedSize(900,800);//设置页面大小this->setWindowTitle("鹏哥快聊");//设置标题this->setWindowIcon(QIcon("C:\\Users\\wgh\\Pictures\\Camera Roll\\1\\wodepeizhenshi.png"));//标题前加上图标QLabel*label1=new QLabel(this);//创建一个对象label1->resize(900,300);//设置大小label1->setPixmap(QPixmap("C:\\Users\\wgh\\Pictures\\Camera Roll\\1\\logo.png"));//导入图片label1->setScaledContents(true);//自适应缩放QLabel*label2=new QLabel(this);label2->resize(70,70);label2->move(100,400);label2->setPixmap(QPixmap("C:\\Users\\wgh\\Pictures\\Camera Roll\\1\\userName.jpg"));label2->setScaledContents(true);QLineEdit*edit1=new QLineEdit(this);edit1->setPlaceholderText("QQ号码/手机/邮箱");//设置占位文本edit1->resize(400,70);edit1->move(label2->x()+120,400);//移动到label2的右边120像素,页面400像素的位置QLabel*label3=new QLabel(this);label3->resize(70,70);label3->move(100,550);label3->setPixmap(QPixmap("C:\\Users\\wgh\\Pictures\\Camera Roll\\1\\passwd.jpg"));label3->setScaledContents(true);QLineEdit*edit2=new QLineEdit(this);edit2->setPlaceholderText("密码");edit2->resize(400,70);edit2->move(label3->x()+120,550);edit2->setEchoMode(QLineEdit::Password);//设置回显状态QPushButton*btn1=new QPushButton(QIcon("C:/Users/wgh/Pictures/Camera Roll/1/login.png"),"登录",this);btn1->resize(120,70);btn1->move(500,700);QPushButton*btn2=new QPushButton(QIcon("C:/Users/wgh/Pictures/Camera Roll/1/cancel.png"),"取消",this);btn2->resize(120,70);btn2->move(btn1->x()+140,700);
}Widget::~Widget()
{
}


http://www.ppmy.cn/news/1074027.html

相关文章

从LeakCanary看内存快照解析

在从LeakCanary看内存快照生成一节中&#xff0c;我们已经了解了hprof的生成&#xff0c;并且将生成的hprof文件通过Android Studio进行解析&#xff0c;确实发现了内存泄漏对象MainActivity&#xff0c;但是在实际开发中&#xff0c;要求开发者自己去手动pull hprof文件进行解…

CountDownLatch、Semaphore详解——深入探究CountDownLatch、Semaphore源码

这篇文章将会详细介绍基于AQS实现的两个并发类CountDownLatch和Semaphore&#xff0c;通过深入底层源代码讲解其具体实现。 目录 CountDownLatch countDown() await() Semaphore Semaphore类图 Semaphore的应用场景 acquire() tryAcquire() CountDownLatch /*** A synchroni…

C++设计模式_02_面向对象设计原则

文章目录 1. 面向对象设计&#xff0c;为什么&#xff1f;2. 重新认识面向对象3. 面向对象设计原则3.1 依赖倒置原则(DIP)3.2 开放封闭原则(OCP )3.3 单一职责原则( SRP )3.4 Liskov 替换原则 ( LSP )3.5 接口隔离原则 ( ISP )3.6 优先使用对象组合&#xff0c;而不是类继承3.7…

QT 常用类与组件

0 思维导图 1 信息调试类&#xff08;QDebug&#xff09; #include "widget.h" #include<iostream> //printf #include<QDebug> //qDebuf using namespace std; //coutWidget::Widget(QWidget *parent): QWidget(parent) {//输出函数//使用…

Linux学习之RAID删除

参考《Linux软件raid删除》 我部署 RAID的步骤在《Linux学习之RAID》 sudo umount /dev/md0先进行卸载。 sudo mdadm -S /dev/md0停止/dev/md0。 sudo mdadm -A -s /dev/md0可以重新开始/dev/md0&#xff0c;这里只是拓展一下。 sudo mdadm -S /dev/md0停止/dev/md0。 s…

【Go 基础篇】Go语言结构体基本使用

在Go语言中&#xff0c;结构体是一种重要的数据类型&#xff0c;用于定义和组织一组不同类型的数据字段。结构体允许开发者创建自定义的复合数据类型&#xff0c;类似于其他编程语言中的类。本文将深入探讨Go语言中结构体的定义、初始化、嵌套、方法以及与其他语言的对比&#…

com.squareup.okhttp3:okhttp 组件安全漏洞及健康度分析

组件简介 维护者square组织许可证类型Apache License 2.0首次发布2016 年 1 月 2 日最新发布时间2023 年 4 月 23 日GitHub Star44403GitHub Fork9197依赖包5,582依赖存储库77,217 com.squareup.okhttp3:okhttp 一个开源的 HTTP 客户端库&#xff0c;可以用于 Android 和 Jav…

Java XPath 使用(2023/08/29)

Java XPath 使用&#xff08;2023/08/29&#xff09; 文章目录 Java XPath 使用&#xff08;2023/08/29&#xff09;1. 前言2. 技术选型3. 技术实现 1. 前言 众所周知&#xff0c;Java 语言适合应用于 Web 开发领域&#xff0c;不擅长用来编写爬虫。但在 Web 开发过程中有时又…