summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qcalendar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QCalendarBackend: link to the relevant plugin documentationEdward Welbourne2024-04-261-2/+2
| | | | | | | | | The docs mention in passing the option of writing a plugin, but lack any link to where to find the details of that. Task-number: QTBUG-115200 Change-Id: Ibd29516d63c55784236860f81048a425c9620223 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add QCalendar::matchCenturyToWeekday()Edward Welbourne2023-12-081-5/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes a YearMonthDay and a day-of-the-week, returning a QDate that (if possible, else invalid) has the given day of the week and differs from the YearMonthDay only in the century. This is useful when resolving dates with only two-digit year information, which can be disambiguated by the day of the week. Added tests of the new API. This adds a new virtual method to QCalendarBackend, for which that base class does provide a brute force implementation, so derived classes do not need to add implementations. It is, however, a binary-incompatible change for any backend plugins that may be in use to implement custom calendars. Worked out the details for the Gregorian calendar to make it possible to compute the right century (and whether any century works) without trial-and-error searching. Coded that up as its implementation of the new method. [ChangeLog][QtCore][QCalendar] Added a matchCenturyToWeekday() method for use when resolving dates given day, month and last two digits of the year, along with day of the week. Any custom calendar backend plugins shall need a recompile and may, optionally, implement the new virtual method behind this. Change-Id: I6003c8d9423d6bfb833957bb5120f2d423219c7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore/QCalendarRegistry: Move helper CaseInsensitiveAnyStringViewLessThan ↵Friedemann Kleint2023-01-311-6/+3
| | | | | | | | | | | | | | out of anonymous namespace It causes a warning in CMake Unity (Jumbo) builds: src/corelib/time/qcalendar.cpp:46: warning: QtPrivate::QCalendarRegistry has a field QtPrivate::QCalendarRegistry::byName whose type uses the anonymous namespace [-Wsubobject-linkage] Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ie9598c3e87dd835b06cafe5392766bddc258b5ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRoundingDown: make the numerator a template parameterEdward Welbourne2023-01-191-1/+1
| | | | | | | | | | It's always a constexpr (or static const that could be constexpr; fix the cases of this while I'm here) or an integer literal, so we can, so we might as well. Change-Id: I61e9bcdb27f4a05f011ccce16b5f15d0dade0782 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QCalendar: fix buildMarc Mutz2022-02-051-0/+6
| | | | | | | | | | | | | | | | Apple Clang 12: qcalendar.cpp:456:22: error: loop variable '[key, value]' is always a copy because the range of type 'QFlatMap<QString, QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QStringList, std::vector<QCalendarBackend *> >' (aka 'QFlatMap<QString, QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QList<QString>, vector<QCalendarBackend *> >') does not return a reference [-Werror,-Wrange-loop-analysis] for (const auto &[key, value] : byName) { ^ Change-Id: I54f205f6b7314351b078fffd16d05e5cd3ef4c22 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QCalendar: port registry from QHash to QFlatMapMarc Mutz2022-01-301-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike many other uses of QFlatMap, this actually promises to hit the QFlatMap sweet spot, and we're using all its levers. To wit: - Enable lookup via QAnyStringView through a transparent comparator without having to convert the QAnyStringView to QString first. This is impossible with QHash, because qHash() values are not consistent for different string types: u"a"_qsv == "a"_L1, but qHash(u"a"_qsv) != qHash("a"_L1). The relational operators don't have this consistency problem, and they also implement case-insensitive comparison, another thing qHash lacks. - Pick different types of containers for keys and values. For the keys, use QStringList, which makes availableCalendars() trivial and extremely fast. We can reserve() the flat_map to limit the effect of reallocations, because we have a pretty good idea about how many entries we'll have. For the values, use the same container as for byID. This might be better with QVarLengthArray, but that's for another patch. - Fix the double lookup in registerBackendLockHeld() by using try_emplace() instead of contains() + insert(). To enable QFlatMap's full potential, we still need to teach ensurePopulated() to create the two containers for the QFlatMap unordered and let QFlatMap sort them in one go, but that, too, is for another patch. Change-Id: I7fe4f3f7596e9b234696fbc8e467128b85629f8a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QCalendar: replace two overloads with one QAnyStringView functionMarc Mutz2022-01-301-9/+5
| | | | | | | | | The backend was already ported, so this is just about applying QT_REMOVED_SINCE and updating the docs. Change-Id: I2c78908deb9cdb3cee19ce8bc148ab3117c1ad9a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCalendar: replace ostream-style qWarning with printf-style oneMarc Mutz2022-01-281-3/+2
| | | | | | | | Saves the <qdebug.h> include and expands to a lot less code. Pick-to: 6.3 6.2 Change-Id: Ic1a0aa707e7c0d4bd54da45a7fcafbf898681b2d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCalendar: eradicate Java-style iteratorMarc Mutz2022-01-281-4/+9
| | | | | | | | | | | | | We had QT_NO_JAVA_STYLE_ITERATORS in .qmake.conf, but it was lost in the transition from QMake to CMake, and - plop - they start trickling in again. Pick-to: 6.3 6.2 Change-Id: Ib92937e5fe510aba2aad92809f7a6d5fbae6f3a0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtCore: includemocsMarc Mutz2022-01-271-0/+4
| | | | | | | | | | | | | | | This leaves moc_qnamespace.cpp in mocs_compilation.cpp. Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Change-Id: Ifdff378c74828e12ec770cb2f453dab3a880e2a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QCalendar: move memory allocation out of critical sectionMarc Mutz2022-01-271-1/+2
| | | | | | | | | | | | By Amdahl's Law, provides for more scalability. This is just for backporting. The registry should really be able to perform lookups without allocating memory... Pick-to: 6.3 6.2 Change-Id: Ifbb832a06991b9ee9a1fd6a43db567bb572fca4f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use \inmodule for all classes and headersTopi Reinio2022-01-171-0/+1
| | | | | | | | | | | | | | | QDoc made some assumptions about the module a class/header belongs to, based on the source file path. This feature is rather error-prone and unnecessarily complex and will be removed from QDoc. Define modules explicitly to avoid documentation warnings when this removal happens. Pick-to: 6.2 6.3 Change-Id: I7947d197db5ac36c12e816caa19bb2f74eda8849 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* corelib: Fix typos in documentationJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Fix documentation issues for Qt CoreTopi Reinio2021-08-241-14/+14
| | | | | | | | | | | | | | * Tag deprecated Q(Multi)Map operators in the header to correctly match them with documentation \fn commands. * Add documentation for QByteArrayView comparison operators. * Add a dummy typedef 'jfieldID' for generating docs correctly on non-Android platforms * Fix other minor issues Pick-to: 6.2 Task-number: QTBUG-95860 Change-Id: I141d2f75d6aa10557aa374201f09ad74b4cd6e81 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QCalendarRegistry: Explicitly disable moving and copyingIevgenii Meshcheriakov2021-08-101-0/+2
| | | | | | | | | | | | | | | | | | | Add Q_DISABLE_COPY_MOVE to QCalendarRegistry to silence the following warning produced by QtStaticAnalysisBot: class 'QCalendarRegistry' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator QCalendarRegistry is a singleton so it does not need to be moved or copied. The warning was introduced by d0ae1ef33a6eed02acde7304298794f4f0119e16. Task-number: QTBUG-93004 Pick-to: 6.2 Change-Id: I5e018346415b9d0a1ebc3bbde2ab7c3ad5e6d9d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCalendar: Delete registered calendar backends on program exitIevgenii Meshcheriakov2021-08-061-15/+71
| | | | | | | | | Add code to check if the calendar registry is destroyed to all QCalendar methods that dereference QCalendarBackend pointer. Pick-to: 6.2 Change-Id: I9b562355e2e0579396b52968f6065c6927cc9ca8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCalendar: Thread-safe calendar backend registrationIevgenii Meshcheriakov2021-08-061-362/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All calendar backend accounting was moved into QCalendarRegistry class (renamed from Registry). Calendar backends are no longer registered inside constructors, because in multithreaded environment this may lead to incompletely initialized instances becoming visible via QCalendar API in multithreaded environment. All system backends are registered by QCalendarRegistry itself when they are needed. New method QCalendarBackend::registerCustomBackend() is provided to register any 3rd-party calendar backends. Registration by names was also simplified. The list of names is now passed to QCalendarBackend::registerCustomBackend(). The checks are provided to ensure that all system backends have non-conflicting names. Name conflicts for custom backends are resolved in favor of earlier registered backends, as it is already the case in the existing code. The documentation was updated to reflect that. Method QCalendarBackend::names() was added to query the list of names associated with a backend after it is registered. Calendar backend deregistration was completely removed because it is not possible to perform it safely without reference counting. Fixes: QTBUG-93004 Pick-to: 6.2 Change-Id: I0ab1eccc02fdd1e1c66b5e5dd076c93de32d5a49 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCalendarBackend: Use QAnyStringView to create backends by nameIevgenii Meshcheriakov2021-07-271-15/+1
| | | | | | | | | | | | | | Combine two implementations of QCalendarBackend::byName() accepting QStringView and QLatin1String arguments into one accepting QAnyStringView to reduce code duplication. Add a note to QCalendar constructors accepting strings to do the same for Qt 7. Change-Id: Idfc3b9c61e22712543c723bd94fcd788da52780a Pick-to: 6.2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QCalendarBackend's ID an opaque typeEdward Welbourne2021-07-191-45/+80
| | | | | | | | | | As Giuseppe pointed out in API change review, an opaque type should be used. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I862a6f52d284317e1243fd91f45bb0af130d154a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove qualification for Julian calendarAlex Blasche2021-03-231-1/+1
| | | | | | | | | The given qualification was wrong but also not needed in the first place, Fixes: QTBUG-92046 Pick-to: 6.1 5.15 Change-Id: Id28347fee2ef11ffcb0df8320b1025568b59de9c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Provide calendar backends with a unique IDEdward Welbourne2021-02-181-90/+255
| | | | | | | | | | | | | | | | | | | | Registration by ID allows for detection of duplicate instantiation of built-in back-ends, which can be detected and flagged by setting the ID to ~size_t(0) instead of the enum value for which it sought to be registered. A new method, calendarId(), is provided to access this; while the old calendarSystem() becomes non-virtual, as it can be inferred (when registration was successful) from the ID. Make registration by name or alias conditional on successful registration by ID. Previously, failed registration by name precluded registration by ID, which now becomes the authoritative registration. This incidentally makes it possible to add a QCalendar constructor taking the unique ID of a backend, for use in conjunction with custom calendar implementations. Change-Id: Ib22925a8ac3ef9439a09ec3855f6231cf9b91c21 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QCalendar's backend registration reentrant-safeEdward Welbourne2021-01-251-32/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, different threads instantiating the same back-end could collide in the register, with various unwelcome results. Give Registry an atomic status flag to track whether it has been populated or is being destroyed; and protect it with a mutex to ensure distinct threads do not collide during registration or attempt to register while the registry is being destroyed. Document the correct way to instantiate custom backends, and that no code other than the QCalendar implementation should instantiate the built-in ones. Instantiators that follow these rules should be safe from failed registrations, provided they don't pick a name that conflicts with some other backend. They can also use the recent change to semantics of registerAlias() to verify that registration *has* succeeded. Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Pick-to: 6.0 5.15 Task-number: QTBUG-88815 Task-number: QTBUG-85692 Fixes: QTBUG-84575 Change-Id: Ie78e700e71d610454152c05cafb38f6f713649ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Check date validity in calendar methods taking a QDateEdward Welbourne2020-12-101-2/+2
| | | | | | | | | Previously neglected, in dateFromParts() and dayOfWeek(), which only make sense for valid dates. Pick-to: 6.0 5.15 Change-Id: I44879bb441dbf51b96c8fd4d45e8f07423e63047 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enable testing for whether a calendar registered its primary nameEdward Welbourne2020-12-041-24/+94
| | | | | | | | | | | | | | | | | In registerAlias(), return true if this instance is already registered with the given name. Previously there was no way for a QCalendarBackend to tell whether its primary name registration had succeeded, during instantiation (other than by devious hackery using a QCalendar instance with the name and some form of back-channel in the instance). Use this in backendFromEnum() to catch cases in which (e.g. due to a race condition) a new instance isn't the one that got registered. Pick-to: 6.0 5.15 Change-Id: I468ac364a68bf3574cd7f8b8b1e672d8fd969111 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCalendar: increase coverage by testsEdward Welbourne2020-11-271-1/+2
| | | | | | | | | | | | Added tests for aliases and various calendar properties, ensured dateToJulianDay()'s invalid date branch is exercised. Corrected assertion when constructing from system and asserted calendarSystem() is as expected. Pick-to: 5.15 Task-number: QTBUG-88183 Change-Id: I510afcb5d9d115f68148d1f679f3224d712f92f4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Break out calendar backend-from-enum as a static functionEdward Welbourne2020-10-061-27/+38
| | | | | | | | | | This lets the registry's populate() avoid recursing into constructors that are typically what (indirectly) called it. This, in turn, makes it possible to assert the constructor from enum gets what it expects. Pick-to: 5.15 Change-Id: I190f9dcfe405e3ee1c6a3f0926fa33cf9ddf64e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCalendar: fixup includesGiuseppe D'Angelo2020-10-061-1/+1
| | | | | | | | Remove an unused one, and add a used one. Pick-to: 5.15 Change-Id: Ic8b2fc7d0fa1e703b7cbbc622b98a626dd0f6ced Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCalendar: use LGPL like everything else, not GPLEdward Welbourne2020-09-271-5/+15
| | | | | | | | Pointed out by Lars. Change-Id: Idb8427d77b35c84eb3037703957cf7f93ea5f387 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QCalendarBackend: format "enum" as code where usedEdward Welbourne2020-08-201-8/+11
| | | | | | | | Also mark some internal methods as \internal. Pick-to: 5.15 Change-Id: I0ae8dc315e5012eea2f3c35ae7d09c3cbb318ab5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Document QCalendarBackend::name()Edward Welbourne2020-08-201-1/+8
| | | | | | | | Neglected previously. Pick-to: 5.15 Change-Id: I0acd9f77d1623a1fcd8766f734c350316401b3a9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QCalendar: actually remember if the registry has been populatedGiuseppe D'Angelo2020-08-061-0/+2
| | | | | | | | The "populated" variable is otherwise never written into. Change-Id: I979411a19927dc4e7e09c6c36edfb2308f519596 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change qHash() to work with size_t instead of uintLars Knoll2020-04-091-1/+1
| | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Pass QDate and QTime as value classesEdward Welbourne2020-02-271-2/+2
| | | | | | | | | It's what they are, so const refs are needless burden. In the process, consolidate two of the affected methods (one of which just adds another argument to the other's signature) into one. Change-Id: I80de35ffe078a652d1999889dede0b10302abaa9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clarify handling of unspecified year in two QCalendar methodsEdward Welbourne2020-01-311-2/+9
| | | | | | | | | | [ChangeLog][QtCore] QCalendar::monthsInYear(QCalendar::Unspecified) now returns maximumMonthsInYear(). QCalendar::daysInYear() now makes clear that its handling of unspecified year is undefined. Change-Id: Ifef8723193868c666f6afeb7f190af4929d30dea Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix qdoc compilation errors qtbaseNico Vertriest2020-01-171-1/+1
| | | | | | Task-number: QTBUG-79824 Change-Id: I5a39525e3e735415ba96e2d585c5de754deb15de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* QCalendar: Optimize std::vector accessv5.14.0-rc2v5.14.0Ulf Hermann2019-12-071-2/+2
| | | | | | | | | | | | | As we assert on the size of the vector before accessing it, there is no point in using the checked at() method over operator[]. Besides, if at() throws, what are we going to do with the exception anyway. Incidentally, this also works around a compiler bug causing binary incompatibility in QtQml. Change-Id: I460e7514429daecabc304eb2c5f96ed715008b0a Fixes: QTBUG-80535 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix QCalendar::isValid(): make it constEdward Welbourne2019-09-261-1/+10
| | | | | | | | Spotted in API change review, thanks to Albert Astals Cid. Also added documentation of this method. Change-Id: I2ef2c526a98b571a3cb3bb5f93d1952b1b0d63a9 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Reflow documentation after indentation changeEdward Welbourne2019-09-161-94/+99
| | | | | | | | Combining this with the indentation would be counted as mixing space changes with non-space changes, so they're separate. Change-Id: Iac57050717b1c4c86a253866c9a6cd5ea7add8f7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Standardize indentation of calendar code's documentationEdward Welbourne2019-09-161-213/+213
| | | | | | | | | | | There was a haphazard mix of 4-space and 2-space indents. Use four spaces throughout. This commit includes no reflow (which is needed), as the inanity-bot will complain about the mixing of space changes with "non-space" changes if I do that. Change-Id: If55ab035da02d0770471e77ecfe00eb168a3da15 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Clarify documentation of daysInMonth()Edward Welbourne2019-09-051-3/+4
| | | | | Change-Id: I86258512c33cabec8d11ff3c794934f40850e413 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Refine QCalendar::hasYearZero()'s documentationEdward Welbourne2019-09-051-23/+23
| | | | | Change-Id: I06697485c6be1c31998d0da54b357f3f5c8701e7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Rename calendar methods from m{in,ax} to m{in,ax}imumEdward Welbourne2019-09-041-24/+25
| | | | | | | | | Words should not be abbreviated. Split a long line and reflowed some comments in the process. Fixes: QTBUG-78008 Change-Id: I52d75409f02e2cecbed3e94d424617ad594c275b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix some qdoc warnings in 5.14Friedemann Kleint2019-09-031-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark QCalendarBackend as internal since it is in a private header and fix some issues in the QCalendar related classes. src/corelib/time/qcalendar.cpp:201: (qdoc) warning: clang found diagnostics parsing \fn int QCalendarBackend::daysInMonth(int month, int year) const error: incomplete type 'QCalendarBackend' named in nested name specifier (repeats) src/corelib/time/qdatetime.cpp:1426: (qdoc) warning: Unknown command '\override' (repeats) src/corelib/time/qcalendar.cpp:642: (qdoc) warning: Undocumented enum item 'Last' in QCalendar::System src/corelib/time/qcalendar.cpp:642: (qdoc) warning: Undocumented enum item 'User' in QCalendar::System src/corelib/time/qcalendar.cpp:744: (qdoc) warning: Undocumented parameter 'year' in QCalendar::isLeapYear() src/corelib/time/qcalendar.cpp:923: (qdoc) warning: Can't link to 'dateTimeString()' (repeats) src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'year' in QCalendar::partsFromDate() src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'month' in QCalendar::partsFromDate() src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'day' in QCalendar::partsFromDate() src/corelib/time/qdatetime.cpp:1425: (qdoc) warning: Undocumented parameter 'nmonths' in QDate::addMonths() src/corelib/time/qdatetime.cpp:1467: (qdoc) warning: Undocumented parameter 'nyears' in QDate::addYears() src/corelib/statemachine/qstatemachine.cpp:2522: (qdoc) warning: Undocumented enum item 'StateMachineChildModeSetToParallelError' in QStateMachine::Error src/corelib/kernel/qtimer.cpp:602: (qdoc) warning: Undocumented parameter 'connectionType' in QTimer::callOnTimeout() src/corelib/time/qcalendar.cpp:159: (qdoc) warning: Undocumented parameter 'name' in QCalendarBackend::QCalendarBackend() src/corelib/time/qcalendar.cpp:159: (qdoc) warning: Undocumented parameter 'id' in QCalendarBackend::QCalendarBackend() src/corelib/time/qcalendar.cpp:529: (qdoc) warning: Can't link to 'registerCalendar()' src/corelib/time/qcalendar.cpp:529: (qdoc) warning: Can't link to 'fromName()' src/corelib/time/qcalendar.cpp:178: (qdoc) warning: Can't link to 'QCalendar::fromEnum()' src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Undocumented parameter 'jd' in QCalendarBackend::dayOfWeek() src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Can't link to 'weekDayName()' src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Can't link to 'standaloneWeekDayName()' src/corelib/time/qcalendar.cpp:268: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:268: (qdoc) warning: Can't link to 'isLeapYear()' src/corelib/time/qcalendar.cpp:295: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isLuniSolar()' src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isSolar()' src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isLunar()' src/corelib/time/qcalendar.cpp:340: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:357: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:544: (qdoc) warning: Can't link to 'fromName()' Change-Id: Ia2fabefb917f8e4cfa361044d9b754717276f4aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix spelling of primarily in QCalendar::isSolar()'s docEdward Welbourne2019-08-301-1/+1
| | | | | | | It was missing a y. Change-Id: I12dac02e451addff966f554811ca1999acadbb1b Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* Add support for the Islamic Civil calendarSoroush Rabiei2019-08-221-0/+8
| | | | | | | | | | | | | | | | This has its own locale data, extracted from CLDR. This data may potentially be shared with other variants on the Islamic calendar, so is handled by a separate base-class, QHijriCalendar, on which such variants may base their implementations. [ChangeLog][QtCore][QCalendar] Added support for the Islamic Civil calendar, controlled by feature islamiccivilcalendar, with locale data that can be shared with other implementations, controlled by feature hijricalendar. Fixes: QTBUG-56675 Change-Id: Idf32d3da7034baa8ec5e66ef847e59a8a2f31cbd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add support for the Jalali (Solar Hijri or Persian) calendarSoroush Rabiei2019-08-211-0/+8
| | | | | | | | | | | | This has its own locale data, extracted from CLDR. [ChangeLog][QtCore][QCalendar] Added support for the Jalali (Persian or Solar Hijri) calendar, controlled by feature jalalicalendar. Fixes: QTBUG-58404 Change-Id: Id5c56a10db05a4fd612aafc01615273db81ec743 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add support for Julian and Milankovic calendarsSoroush Rabiei2019-08-211-0/+14
| | | | | | | | | | | | | These share their locale data with the Gregorian calendar, making them virtually free to add. Still leave them out of the boot-strap build, though. [ChangeLog][QtCore][QCalendar] Added support for Julian and Milankovic calendars. These are enabled by default, except in bootstrap builds. Change-Id: I585045ed9e78c1e959957f6772b3e144093b701c Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add support for calendars beside GregorianSoroush Rabiei2019-08-201-0/+1060
Add QCalendarBackend as a base class for calendar implementations and QCalendar as a facade via which to access it. QDate's implicit implementation of the Gregorian calendar becomes QGregorianCalendar and QDate methods now support choice of calendar. Convert QLocale's CLDR data for month names to a locale-data component of each supported calendar and relevant QLocale methods now support choice of calendar. Adapt Python scripts for locale data generation to extract month name data from CLDR (keeping on version v35.1) into the new calendar-locale files. The locale data for the Gregorian calendar is held in a Roman calendar base, for sharing with other calendars. Add tests for basic uses of the new API. [ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse calendars, supported by implementing QCalendarBackend. [ChangeLog][QtCore][QDate] Allow choice of calendar in various operations, with Gregorian remaining the default. Done-with: Lars Knoll <lars.knoll@qt.io> Done-with: Edward Welbourne <edward.welbourne@qt.io> Fixes: QTBUG-17110 Fixes: QTBUG-950 Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>