当前位置: 首页 > article >正文

QT6 源(82):阅读与注释日历类型 QCalendar,本类并未完结,儒略历,格里高利历原来就是公历,

(1)本代码来自于头文件 qcalendar . h

#ifndef QCALENDAR_H
#define QCALENDAR_H#include <limits>#include <QtCore/qglobal.h>
#include <QtCore/qlocale.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringview.h>/* Suggested enum names for other calendars known to CLDR (v33.1)Not yet implemented - see QCalendar::System - contributions welcome:* Buddhist -- Thai Buddhist, to be specific* Chinese* Coptic* Dangi -- Korean* Ethiopic (Amete Mihret - epoch approx. 8 C.E.)* EthiopicAmeteAlem (Amete Alem - epoch approx. 5493 B.C.E; data fromtype="ethiopic-amete-alem", an alias for type="ethioaa")* Hebrew* Indian -- National* Islamic -- Based on astronomical observations, not predictions, so hard toimplement. CLDR's data for type="islamic" apply, unless overridden, to theother Islamic calendar variants, i.e. IslamicCivil, above, and the threefollowing. See QHijriCalendar, a common base to provide that data.* IslamicTabular -- tabular, astronomical epoch (same as IslamicCivil, exceptfor epoch), CLDR type="islamic-tbla"* Saudi -- Saudi Arabia, sighting; CLDR type="islamic-rgsa"* UmmAlQura -- Umm al-Qura, Saudi Arabia, calculated; CLDR type="islamic-umalqura"* Iso8601 -- as Gregorian, but treating ISO 8601 weeks as "months"* Japanese -- Imperial calendar* Minguo -- Republic of China, Taiwan; CLDR type="roc"See:http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xmlThese can potentially be supported, as features, using CLDR's data; anyothers shall need hand-crafted localization data; it would probably be bestto do that by contributing data for them to CLDR.
*/QT_BEGIN_NAMESPACEclass QCalendarBackend;
class QDate;/*
The QCalendar class describes calendar systems.QCalendar对象使用特定系统的规则将年、月和日数映射到特定的日期(最终由其儒略日数标识).默认的 QCalendar()是一个推算的格里高利历,没有零年。
通过启用合适的功能或加载插件,可以支持其他日历。
作为功能支持的日历可以通过将QCalendar:System 枚举传递给构造函数来构建。
所有支持过的日历在构建后都可以通过名称来构建。
(因此插件会实例化它们的日历后端以进行注册。)通过 QCalendar::System 可访问的内置后端也总是可以通过名称获取。使用自定义后端的时间表也可以在构建时使用分配给后端的-个唯-ID来构建。QCalendar值是不可变的。
*/class Q_CORE_EXPORT QCalendar
{Q_GADGETprivate:// Always supplied by QCalendarBackend and expected to be a singleton// Note that the calendar registry destroys all backends when it is itself// destroyed. The code should check if the registry is destroyed before// dereferencing this pointer.const QCalendarBackend * d_ptr;public:// (Extra parentheses to suppress bogus reading of min() as a macro.)enum : int { Unspecified = (std::numeric_limits<int>::min)() };struct YearMonthDay{YearMonthDay() = default;YearMonthDay(int y, int m = 1, int d = 1) : year(y), month(m), day(d) {}bool isValid() const{ return month != Unspecified && day != Unspecified; }// (The first year supported by QDate has year == Unspecified.)int year = Unspecified;int month = Unspecified;int day = Unspecified;};// Feature (\w+)calendar uses CLDR type="\1" data,// except as noted in type="..." comments belowenum class System{Gregorian, // CLDR: type = "gregory", alias = "gregorian"#ifndef QT_BOOTSTRAPPEDJulian = 8,Milankovic = 9,
#endif // These are Roman-based, so share Gregorian's CLDR data// Feature-controlled calendars:
#if QT_CONFIG(jalalicalendar) // type="persian"Jalali = 10,
#endif// type="islamic-civil", uses data from type="islamic"
#if QT_CONFIG(islamiccivilcalendar)IslamicCivil = 11,// tabular, civil epoch// 30 year cycle, leap on 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29// (Other variants: 2, 5, 8, (10|11), 13, 16, 19, 21, 24, 27 and 29.)
#endifLast = 11, // Highest number of any aboveUser = -1};// New entries must be added to the \enum doc in qcalendar.cpp and// handled in QCalendarBackend::fromEnum()Q_ENUM(System) //接入 Qt 的元对象系统class SystemId{size_t id;friend class QCalendarBackend;constexpr bool isInEnum() const{ return id <= size_t(QCalendar::System::Last); }constexpr explicit SystemId(QCalendar::System e) : id(size_t(e)) { }constexpr explicit SystemId(size_t i) : id(i) { }public:constexpr SystemId() : id(~size_t(0)) {}constexpr size_t index() const noexcept { return id; }constexpr bool isValid() const noexcept { return ~id; }};explicit QCalendar(); // Gregorian, optimisedexplicit QCalendar(System system);// ### Qt 7: removeexplicit QCalendar(QLatin1String name);// ### Qt 7: use QAnyStringViewexplicit QCalendar(QStringView name);explicit QCalendar(SystemId id);// QCalendar is a trivially copyable value type.bool isValid() const { return d_ptr != nullptr; }// Date queries:int    daysInMonth(int month, int year = Unspecified) const;int    daysInYear(int year) const;int  monthsInYear(int year) const;bool isDateValid(int year, int month, int day) const;// Leap years:bool isLeapYear(int year) const;// Properties of the calendar:bool  isGregorian() const;bool  isLunar    () const;bool  isLuniSolar() const;bool  isSolar    () const;bool  isProleptic() const;bool  hasYearZero() const;int   maximumDaysInMonth () const;int   minimumDaysInMonth () const;int   maximumMonthsInYear() const;QString name() const;// QDate conversions:QDate dateFromParts(int year, int month, int day) const;QDate dateFromParts(const YearMonthDay & parts) const;YearMonthDay partsFromDate(QDate date) const;int dayOfWeek(QDate date) const;// Month and week-day names (as in QLocale):QString monthName(          const QLocale & locale,int month, int year = Unspecified ,QLocale::FormatType format = QLocale::LongFormat) const;QString standaloneMonthName(const QLocale & locale,int month, int year = Unspecified ,QLocale::FormatType format = QLocale::LongFormat) const;QString weekDayName(          const QLocale & locale, int day,QLocale::FormatType format = QLocale::LongFormat) const;QString standaloneWeekDayName(const QLocale & locale, int day,QLocale::FormatType format = QLocale::LongFormat) const;// Formatting of date-times:QString dateTimeToString(QStringView format, const QDateTime & datetime,QDate dateOnly, QTime timeOnly,const QLocale & locale) const;// What's available ?static QStringList availableCalendars();}; //完结 class Q_CORE_EXPORT QCalendarQT_END_NAMESPACE#endif // QCALENDAR_H

(2)儒略历,格里高利历原来就是公历

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

(3)现代公历

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

(4)

谢谢

相关文章:

QT6 源(82):阅读与注释日历类型 QCalendar,本类并未完结,儒略历,格里高利历原来就是公历,

&#xff08;1&#xff09;本代码来自于头文件 qcalendar . h &#xff1a; #ifndef QCALENDAR_H #define QCALENDAR_H#include <limits>#include <QtCore/qglobal.h> #include <QtCore/qlocale.h> #include <QtCore/qstring.h> #include <QtCore/…...

CVE体系若消亡将如何影响网络安全防御格局

CVE体系的核心价值与当前危机 由MITRE运营的通用漏洞披露&#xff08;CVE&#xff09;项目的重要性不容低估。25年来&#xff0c;它始终是网络安全专业人员理解和缓解安全漏洞的基准参照系。通过提供标准化的漏洞命名与分类方法&#xff0c;这套体系为防御者建立了理解、优先级…...

OpenKylin安装Elastic Search8

一、环境准备 Java安装 安装过程此处不做赘述&#xff0c;使用以下命令检查是否安装成功。 java -version 注意&#xff1a;Elasticsearch 自 7.0 版本起内置了 OpenJDK&#xff0c;无需单独安装。但如需自定义 JDK&#xff0c;可设置 JAVA_HOME。 二、安装Elasticsearch …...

【ARM AMBA AHB 入门 3 -- AHB 总线介绍】

请阅读【ARM AMBA 总线 文章专栏导读】 文章目录 AHB Bus 简介AHB Bus 构成AHB BUS 工作机制AHB 传输阶段 AHB InterfacesAHB仲裁信号 AHB 数据访问零等待传输(no waitstatetransfer)等待传输(transfers with wait states)多重传送(multipletransfer)--Pipeline AHB 控制信号 A…...

多模态大模型中的视觉分词器(Tokenizer)前沿研究介绍

文章目录 引言MAETok背景方法介绍高斯混合模型&#xff08;GMM&#xff09;分析模型架构 实验分析总结 FlexTok背景方法介绍模型架构 实验分析总结 Emu3背景方法介绍模型架构训练细节 实验分析总结 InternVL2.5背景方法介绍模型架构 实验分析总结 LLAVA-MINI背景方法介绍出发点…...

sqli-labs靶场第二关——数字型

一&#xff1a;查找注入类型&#xff1a; 输入 ?id1--与第一关的差别&#xff1a;报错; 说明不是字符型 渐进测试&#xff1a;?id1--&#xff0c;结果正常&#xff0c;说明是数字型 二&#xff1a;判断列数和回显位 ?id1 order by 3-- 正常&#xff0c; 说明有三列&am…...

使用FastAPI微服务在AWS EKS上实现AI会话历史的管理

架构概述 本文介绍如何使用FastAPI构建微服务架构&#xff0c;在AWS EKS上部署两个微服务&#xff1a; 服务A&#xff1a;接收用户提示服务B&#xff1a;处理对话逻辑&#xff0c;与Redis缓存和MongoDB数据库交互 该架构利用AWS ElastiCache(Redis)实现快速响应&#xff0c;…...

[模型选择与调优]机器学习-part4

七 模型选择与调优 1 交叉验证 (1) 保留交叉验证HoldOut HoldOut Cross-validation&#xff08;Train-Test Split&#xff09; 在这种交叉验证技术中&#xff0c;整个数据集被随机地划分为训练集和验证集。根据经验法则&#xff0c;整个数据集的近70%被用作训练集&#xff…...

【计算机网络-数据链路层】以太网、MAC地址、MTU与ARP协议

&#x1f4da; 博主的专栏 &#x1f427; Linux | &#x1f5a5;️ C | &#x1f4ca; 数据结构 | &#x1f4a1;C 算法 | &#x1f152; C 语言 | &#x1f310; 计算机网络 上篇文章&#xff1a;传输层-TCP协议TCP核心机制与可靠性保障 下篇文章&#xff1a; 网络…...

学习适应对智能软件对对象的属性进行表征、计算的影响

下面的链接是我新发表的文章。这篇文章是关于智能软件对对象进行标志、表征的问题&#xff0c;这是所有智能实体都无法回避的基本问题。 我最近写了一篇关于奖惩系统的文章。并开始写智能是如何在基础编程的基础上涌现出来的文章。 https://www.oalib.com/articles/6857382 …...

vue 组件函数式调用实战:以身份验证弹窗为例

通常我们在 Vue 中使用组件&#xff0c;是像这样在模板中写标签&#xff1a; <MyComponent :prop"value" event"handleEvent" />而函数式调用&#xff0c;则是让我们像调用一个普通 JavaScript 函数一样来使用这个组件&#xff0c;例如&#xff1a;…...

多线程面试题总结

基础概念 进程与线程的区别 进程:操作系统资源分配的基本单位,有独立内存空间线程:CPU调度的基本单位,共享进程资源对比: 创建开销:进程 > 线程通信方式:进程(IPC)、线程(共享内存)安全性:进程更安全(隔离),线程需要同步线程的生命周期与状态转换 NEW → RUNNABLE …...

Kafka 与 RabbitMQ、RocketMQ 有何不同?

一、不同的诞生背景&#xff0c;塑造了不同的“性格” 名称 背景与目标 产品定位 Kafka 为了解决 LinkedIn 的日志收集瓶颈&#xff0c;强调吞吐与持久化 更像一个“可持久化的分布式日志系统” RabbitMQ 出自金融通信协议 AMQP 的实现&#xff0c;强调协议标准与广泛适…...

【比赛真题解析】篮球迷

本次给大家分享一道比赛的题目:篮球迷。 洛谷链接:U561543 篮球迷 题目如下: 【题目描述】 众所周知,jimmy是个篮球迷。众所周知,Jimmy非常爱看NBA。 众所周知,Jimmy对NBA冠军球队的获奖年份和队名了如指掌。 所以,Jimmy要告诉你n个冠军球队的名字和获奖年份,并要求你…...

【MATLAB源码-第277期】基于matlab的AF中继系统仿真,AF和直传误码率对比、不同中继位置误码率对比、信道容量、中继功率分配以及终端概率。

操作环境&#xff1a; MATLAB 2022a 1、算法描述 在AF&#xff08;放大转发&#xff09;中继通信系统中&#xff0c;信号的传输质量和效率受到多个因素的影响&#xff0c;理解这些因素对于系统的优化至关重要。AF中继通信的基本架构由发射端、中继节点和接收端组成。发射端负…...

webRtc之指定摄像头设备绿屏问题

摘要&#xff1a;最近发现&#xff0c;在使用navigator.mediaDevices.getUserMedia({ deviceId: ‘xxx’}),指定设备的时候&#xff0c;video播放总是绿屏&#xff0c;发现关闭浏览器硬件加速不会出现&#xff0c;但显然这不是一个最好的方案; 播放后张这样 修复后 上代码 指定…...

2023年03月青少年软件编程(图形化)等级考试四级编程题

求和 1.准备工作 &#xff08;1&#xff09;保留舞台中的小猫角色和白色背景。 2.功能实现 &#xff08;1&#xff09;计算1&#xff5e;100中&#xff0c;可以被3整除的数之和&#xff1b; &#xff08;2&#xff09;说出被3整除的数之和。 标准答案&#xff1a; 参考程序&…...

ensp的华为小实验

1.先进行子网划分 2.进行接口的IP地址配置和ospf的简易配置&#xff0c;先做到全网小通 3.进行ospf优化 对区域所有区域域间路由器进行一个汇总 对区域1进行优化 对区域2.3进行nssa设置 4.对ISP的路由进行协议配置 最后ping通5.5.5.5...

ragflow报错:KeyError: ‘\n “序号“‘

环境&#xff1a; ragflowv 0.17.2 问题描述&#xff1a; ragflow报错&#xff1a;KeyError: ‘\n “序号”’ **1. 推荐表&#xff08;输出json格式&#xff09;** [{"},{},{"},{} ]raceback (most recent call last): May 08 20:06:09 VM-0-2-ubuntu ragflow-s…...

Java大数据可视化在城市空气质量监测与污染溯源中的应用:GIS与实时数据流的技术融合

随着城市化进程加速&#xff0c;空气质量监测与污染溯源成为智慧城市建设的核心议题。传统监测手段受限于数据离散性、分析滞后性及可视化能力不足&#xff0c;难以支撑实时决策。2025年4月27日发布的《Java大数据可视化在城市空气质量监测与污染溯源中的应用》一文&#xff0c…...

FHE与后量子密码学

1. 引言 近年来&#xff0c;关于 后量子密码学&#xff08;PQC, Post-Quantum Cryptography&#xff09; 的讨论愈发热烈。这是因为安全专家担心&#xff0c;一旦有人成功研发出量子计算机&#xff0c;会发生什么可怕的事情。由于 Shor 算法的存在&#xff0c;量子计算机将能够…...

Flask 调试的时候进入main函数两次

在 Flask 开启 Debug 模式时&#xff0c;程序会因为自动重载&#xff08;reloader&#xff09;的机制而启动两个进程&#xff0c;导致if __name__ __main__底层的程序代码被执行两次。以下说明其原理与常见解法。 Flask Debug 模式下自动重载机制 Flask 使用的底层服务器 Wer…...

cv_area_center()

主题 用opencv实现了halcon中area_center算子的功能&#xff0c; 返回region的面积&#xff0c;中心的行坐标和中心的列坐标 代码很简单 def cv_area_center(region):area[]row []col []for re in region:retval cv2.moments(re)area.append(retval[m00])row.append(int(r…...

CSS: 选择器与三大特性

标签选择器 标签选择器就是选择一些HTML的不同标签&#xff0c;由于它们的标签需求不同&#xff0c;所以CSS需要设置标签去选择它们&#xff0c;为满足它们的需求给予对应的属性 基础选择器 标签选择器 <!DOCTYPE html> <head><title>HOME</title>…...

2505d,d的借用检查器

void func(scope ref int*) {}unique(int*) a ...; assert(a !is null);unique(int*) b a; assert(a is null); assert(b !is null);func(b); // ok用live作为检查器,不必有断定了. int* a ...; int* b a; // 所有权转至b *a 3; // 不能再用a.编译器保证约束指针. live…...

力扣-2.两数相加

题目描述 给你两个 非空 的链表&#xff0c;表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的&#xff0c;并且每个节点只能存储 一位 数字。 请你将两个数相加&#xff0c;并以相同形式返回一个表示和的链表。 你可以假设除了数字 0 之外&#xff0c;这两个数都…...

M0基础篇之ADC

本节课使用到的例程 一、Single模式例程基本配置的解释 在例程中我们只使用到了PA25这一个通道&#xff0c;因此我们使用的是Single这个模式&#xff0c;也就是我们在配置模式的时候使用的是单一转换。 进行多个通道的测量我们可以使用Sequence这个模式。 二、Single模式例程基…...

Nginx安全防护与HTTPS部署

一、安全防护与HTTPS概念 一、安全防护与HTTPS概念 为什么要隐藏版本号&#xff1f; 当访问网站时&#xff0c;能从响应标头查看到server的信息&#xff0c;这里面就包含了是什么web应用及其版本为你提供的服务。如果不隐藏server的版本&#xff0c;会导致别有用心的人知晓…...

C语言_程序的段

在 C 语言程序中,内存通常被分为多个逻辑段,每个段存储不同类型的数据。理解这些段的结构和功能,有助于你更高效地编写、调试和优化程序。以下是 C 语言程序中主要的内存段及其特点: 1. 代码段(Text Segment) 存储内容:编译后的机器指令(程序代码)。特性: 只读:防止…...

OSPF综合实验实验报告

OSPF综合实验实验报告 一、实验拓扑 二、实验要求 1.R5为ISP&#xff0c;其上只能配置IP地址&#xff1b;R4作为企业边界路由器&#xff0c; 出口公网地址需要通过PPP协议获取&#xff0c;并进行chap认证 2&#xff0c;整个OSPF环境IP基于172.16.0.0/16划分&#xff1b; 3&…...