QT -狗狗管理工具

QT -狗狗管理工具

  • 一、演示效果
  • 二、UML
  • 三、关键代码
  • 四、程序链接


一、演示效果

请添加图片描述

请添加图片描述

二、UML

请添加图片描述

三、关键代码

#include <QFrame>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QSizePolicy>
#include <QDialog>
#include <QDialogButtonBox>#include "DogVisitorCard.h"
#include "DogVisitorInfoPanel.h"
#include "Dog/owner.h"
#include "./view/buttons/ButtonsWidget.h"#include "breeds/breed.h"
#include "breeds/amstaff.h"
#include "breeds/bulldog.h"QVBoxLayout* DogVisitorCard::getCard() const{return cardLayout;
}void DogVisitorCard::visitBoarding(Boarding &boarding) {QHBoxLayout* hbox=new QHBoxLayout();dog=&boarding;hbox->addSpacing(30);//left imageQHBoxLayout* img= new QHBoxLayout();QLabel* image= new QLabel();image->setPixmap(QPixmap(":/assets/icons8-dog-house-64.png"));image->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);img->addWidget(image);hbox->addLayout(img);hbox->addSpacing(25);//Dog's infoQVBoxLayout* info= new QVBoxLayout();hbox->addLayout(info);info->setAlignment(Qt::AlignCenter);//nameQLabel* name= new QLabel("Name: "+ QString::fromStdString(boarding.getName()));info->addWidget(name);//dateQLabel* date= new QLabel("Arrival date: "+ QString::fromStdString(boarding.getDate().toString()));info->addWidget(date);//OwnerOwner* owner=boarding.getOwner();std::string OwnerName=owner->getName();std::string OwnerSurname=owner->getSurname();QLabel* ownerString= new QLabel("Owner: " + QString::fromStdString(OwnerName + " " + OwnerSurname));info->addWidget(ownerString);//Optional servicesQLabel* optionalService= new QLabel("Optional services: ");info->addWidget(optionalService);QHBoxLayout* srvc= new QHBoxLayout();info->addLayout(srvc);//BathQLabel* bath= new QLabel();QLabel* bathString= new QLabel("Bath");bath->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (boarding.didBath())bath->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsebath->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));srvc->addWidget(bath);srvc->addWidget(bathString);//DietQLabel* diet= new QLabel();QLabel* dietString= new QLabel("Diet");diet->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (boarding.didDiet())diet->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsediet->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));srvc->addWidget(diet);srvc->addWidget(dietString);//TrainingsQLabel* trainings= new QLabel();QLabel* trainString= new QLabel("Trainings");trainings->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (boarding.didTraining())trainings->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsetrainings->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));srvc->addWidget(trainings);srvc->addWidget(trainString);//WalksQLabel* walks= new QLabel();QLabel* walksString= new QLabel("Walks");walks->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (boarding.didWalking())walks->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsewalks->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));srvc->addWidget(walks);srvc->addWidget(walksString);hbox->addStretch();hbox->addStretch();hbox->addSpacing(25);//put all things toghetercardLayout= new QVBoxLayout();cardLayout->addLayout(hbox);}void DogVisitorCard::visitBreeding(Breeding &breeding) {QHBoxLayout* hbox=new QHBoxLayout();hbox->addSpacing(30);dog=&breeding;//left imageQHBoxLayout* img= new QHBoxLayout();QLabel* image= new QLabel();Breed* bulldogPointer=breeding.getBreed();if(dynamic_cast<Bulldog*>(bulldogPointer))image->setPixmap(QPixmap(":/assets/icons8-french-bulldog-64.png"));elseimage->setPixmap(QPixmap(":/assets/icons8-dog-64.png"));image->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);img->addWidget(image);hbox->addLayout(img);hbox->addSpacing(25);//Dog's infoQVBoxLayout* info= new QVBoxLayout();hbox->addLayout(info);info->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);//nameQLabel* name= new QLabel("Name: "+ QString::fromStdString(breeding.getName()));info->addWidget(name);//dateQLabel* date= new QLabel("Day of birth: "+ QString::fromStdString(breeding.getDate().toString()));info->addWidget(date);//BreedQLabel* breed= new QLabel("Breed: "+QString::fromStdString(breeding.getBreed()->toString()));info->addWidget(breed);//Optional servicesQLabel* options= new QLabel("Options: ");info->addWidget(options);QHBoxLayout* opt= new QHBoxLayout();info->addLayout(opt);//VaxQLabel* vax= new QLabel();QLabel* vaxString= new QLabel("Vaxxed");vax->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (breeding.isVax())vax->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsevax->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));opt->addWidget(vax);opt->addWidget(vaxString);//PurchasableQLabel* purch= new QLabel();QLabel* purchString= new QLabel("Purchasable");purch->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (breeding.isPurchasable())purch->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsepurch->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));opt->addWidget(purch);opt->addWidget(purchString);//BookedQLabel* booked= new QLabel();QLabel* bookedString= new QLabel("Booked");booked->setAlignment(Qt::AlignRight|Qt::AlignCenter);if (breeding.isBooked())booked->setPixmap(QPixmap(":/assets/icons8-done-48.png").scaled(10,10,Qt::KeepAspectRatio));elsebooked->setPixmap(QPixmap(":/assets/icons8-close-48.png").scaled(10,10,Qt::KeepAspectRatio));opt->addWidget(booked);opt->addWidget(bookedString);hbox->addStretch();hbox->addStretch();hbox->addSpacing(25);//put all things toghetercardLayout= new QVBoxLayout();cardLayout->addLayout(hbox);}

四、程序链接

https://download.csdn.net/download/u013083044/88739503

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/628117.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

算法第十八天-打家劫舍Ⅱ

打家劫舍Ⅱ 题目要求 解题思路 [打家劫舍Ⅱ]是说两个相邻的房间不能同时偷&#xff0c;并且首尾两个房间是相邻的&#xff08;不能同时偷首尾房间&#xff09;明显是基于[打家劫舍Ⅰ]做的升级。[打家劫舍Ⅰ]也是说两个相邻的房间不能同时偷&#xff0c;但是首尾房间不是相邻的…

Nas群晖中安装Cpolar实现内网穿透

1、到Cpolar官网中安装对应的套间 cpolar官网&#xff1a; cpolar官网-安全的内网穿透工具 | 无需公网ip | 远程访问 | 搭建网站 2、到群晖nas中安装套间 选择好套间无脑下一步 已完成

时间序列数据的季节性检测

时间序列分析是统计学和数据科学的一个基本研究领域&#xff0c;它为理解和预测序列数据中的模式提供了一个强大的框架。特别是时间序列数据&#xff0c;它捕获连续时间间隔内的信息&#xff0c;使分析师能够揭示趋势&#xff0c;季节性模式和其他时间依赖性。在时间序列分析的…

GPT应用开发:运行你的第一个聊天程序

本系列文章介绍基于OpenAI GPT API开发应用的方法&#xff0c;适合从零开始&#xff0c;也适合查缺补漏。 本文首先介绍基于聊天API编程的方法。 环境搭建 很多机器学习框架和类库都是使用Python编写的&#xff0c;OpenAI提供的很多例子也是Python编写的&#xff0c;所以为了…

PTA(浙大版《C语言程序设计(第3版)》题目集

PTA(浙大版《C语言程序设计&#xff08;第3版&#xff09;》题目集 学习C语言程序设计的PTA题目 目录 PTA(浙大版《C语言程序设计&#xff08;第3版&#xff09;》题目集PTA(浙大版《C语言程序设计&#xff08;第3版&#xff09;》题目集) 习题2-1 求整数均值 (10 分)输入格式:…

JS常用插件 Swiper插件 实现轮播图

Swiper介绍 Swiper 是一款免费以及轻量级的移动设备触控滑块的js框架 中文官网地址: https://www.swiper.com.cn/ 点击查看Swiper演示&#xff0c;里面的功能和样式十分丰富&#xff0c;根据自己的需求选择 中文教程中详细介绍了如何使用Swiper API文档中介绍了各个模块以及参…

如何画出优秀的系统架构图-架构师系列-学习总结

--- 后之视今&#xff0c;亦犹今之视昔&#xff01; 目录 早期系统架构图 早期系统架构视图 41视图解读 41架构视图缺点 现代系统架构图的指导实践 业务架构 例子 使用场景 画图技巧 客户端架构、前端架构 例子 使用场景 画图技巧 系统架构 例子 定义 使用场…

C++面试宝典第19题:最长公共前缀

题目 编写一个函数来查找字符串数组中的最长公共前缀,如果不存在公共前缀,返回空字符串""。说明:所有输入只包含小写字母a-z。 示例1: 输入: ["flower", "flow", "flight"]输出: "fl" 示例2: 输入: ["dog",…

微信小程序快速入门03

&#x1f3e1;浩泽学编程&#xff1a;个人主页 &#x1f525; 推荐专栏&#xff1a;《深入浅出SpringBoot》《java项目分享》 《RabbitMQ》《Spring》《SpringMVC》 &#x1f6f8;学无止境&#xff0c;不骄不躁&#xff0c;知行合一 文章目录 前言一、生命周期生…

手写springBoot启动器

提示&#xff1a;springboot原理&#xff0c;手写springboot启动器&#xff0c;手写模拟SpringBoot启动过程、手写模拟SpringBoot自动配置功能 文章目录 前言一、本文内容1、手写模拟SpringBoot启动过程2、手写模拟SpringBoot自动配置功能 二、项目总体介绍三、代码实现(手写模…

python的库或函数不会用:使用help函数查看函数

help(time) # 查看time这个库 FUNCTIONS #函数&#xff1b;都可以调用asctime(...)asctime([tuple]) -> string #调用这个函数的参数需要一个元组&#xff08;tuple&#xff09;&#xff0c;->&#xff1a;代表返回值是string类型的#下面是简单的介绍Convert a time tup…

k8s的存储卷、数据卷---动态PV创建

当发布PVC之后可以生成PV&#xff0c;还可以在动态服务器上直接生成挂载目录。PVC直接绑定和使用PV。 动态PV需要两个组件 存储卷插件&#xff1a;Provisioner(存储分配器)根据定义的属性创建PV StorageClass&#xff1a;定义属性 存储卷插件 存储卷插件&#xff1a;k8s本…

ElasticSearch降本增效常见的方法 | 京东云技术团队

Elasticsearch在db_ranking 的排名不断上升&#xff0c;其在存储领域已经蔚然成风且占有非常重要的地位。 随着Elasticsearch越来越受欢迎&#xff0c;企业花费在ES建设上的成本自然也不少。那如何减少ES的成本呢&#xff1f;今天我们就特地来聊聊ES降本增效的常见方法&#x…

服务器和电脑有啥区别?

服务器可以说是“高配的电脑”&#xff0c;两者都有CPU、硬盘、电源等基础硬件组成&#xff0c;但服务器和电脑也是有一定区别的&#xff0c;让小编带大家了解一下吧&#xff01; #秋天生活图鉴# 1、稳定性需求不同&#xff1a;服务器是全年无休&#xff0c;需要高稳定性&…

世微大功率 内置2.5A宽电压降压恒流 LED电源驱动车灯IC AP5193

AP5193是一款PWM工作模式,高效率、外围简单、 内置功率MOS管&#xff0c;适用于4.5-100V输入的高精度 降压LED恒流驱动芯片。电流2.5A。AP5193可实现线性调光和PWM调光&#xff0c;线性调光 脚有效电压范围0.55-2.6V. AP5193 工作频率可以通过RT 外部电阻编程来设定&#xff0c…

快乐学Python,数据分析之使用爬虫获取网页内容

在上一篇文章中&#xff0c;我们了解了爬虫的原理以及要实现爬虫的三个主要步骤&#xff1a;下载网页-分析网页-保存数据。 下面&#xff0c;我们就来看一下&#xff1a;如何使用Python下载网页。 1、网页是什么&#xff1f; 浏览器画网页的流程&#xff0c;是浏览器将用户输…

Python代码调试的几种方法总结

使用 pdb 进行调试 pdb 是 python 自带的一个包&#xff0c;为 python 程序提供了一种交互的源代码调试功能&#xff0c;主要特性包括设置断点、单步调试、进入函数调试、查看当前代码、查看栈片段、动态改变变量的值等。pdb 提供了一些常用的调试命令&#xff0c;详情见表 1。…

互联网加竞赛 基于机器视觉的12306验证码识别

文章目录 0 简介1 数据收集2 识别过程3 网络构建4 数据读取5 模型训练6 加入Dropout层7 数据增强8 迁移学习9 结果9 最后 0 简介 &#x1f525; 优质竞赛项目系列&#xff0c;今天要分享的是 基于机器视觉的12306验证码识别 该项目较为新颖&#xff0c;适合作为竞赛课题方向…

6.1810: Operating System Engineering 2023 <Lab7 lock: Parallelism/locking>

一、本节任务 二、要点 2.1 文件系统&#xff08;file system&#xff09; xv6 文件系统软件层次如下&#xff1a; 通过路径树我们可以找到相应的文件&#xff1a; fd&#xff08;文件描述符&#xff09;是进程用来标识其打开的文件的手段&#xff0c;每个进程有自己的文件…

程序员有哪些接s单的渠道?

这题我会&#xff01;程序员接单的渠道那可太多了&#xff0c;想要接到合适的单子&#xff0c;筛选一个合适的平台很重要。如果你也在寻找一个合适的接单渠道&#xff0c;可以参考以下这些方向。 首先&#xff0c;程序员要对接单有一个基本的概念&#xff1a;接单渠道可以先粗…