summaryrefslogtreecommitdiffstats
path: root/src/charts/qchart.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Port Q_FOREACH to ranged-for; local const containersAhmad Samir2023-09-041-6/+4
| | | | | | | | | | | The loops were iterating over local containers; make them const and use ranged-for. In files where all foreach usages are ported, remove "#undef QT_NO_FOREACH". Change-Id: I48f39cd7c30dc183808c8c0e99d0e8373eb804a9 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Port Q_FOREACH to ranged-for, iterating over a temporaryAhmad Samir2023-09-041-3/+6
| | | | | | | | | | | The loops are iterating over a temporary, so hold the temporary in a local const container and use ranged-for. In files where all foreach usages are ported, un-whitelist them by removing "#undef QT_NO_FOREACH". Change-Id: I9e7c9d16404fd78b3cf61465d922616de8e4a1a1 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Mark QtCharts (the library) as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-181-0/+2
| | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses is exremely high here, too high for this author, unfamiliar with this code, to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole library with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). Created QTBUG-115824 to keep track of this, and other such follow-up changes in this module. Task-number: QTBUG-115824 Change-Id: If90d9e29bc4fdce1da97f663be35aa715bd6478b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Docs: Fix Charts API Docs Broken LinksNicholas Bennett2023-06-171-1/+1
| | | | | | | | | Removed some links, mostly pointed to the new collated examples. Fixes: QTBUG-114221 Pick-to: 6.5 6.5.2 6.6 Change-Id: Idac312fb819e7a3bbb0fb2aced7f56f5f90db1c1 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I8187f4b3a16ff78f2a5e5a9158d9437f06a43252 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-161-28/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ibb797d52859b5c504f7300f4a5dc956a7b44ac11 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove charts namespace for Qt6Michal Klocek2020-11-061-2/+2
| | | | | | | | | This auto refactor to remove charts namespace, just use qt one. [ChangeLog] Use QT_NAMESPACE as other modules. Change-Id: I7722ed2ff5cd84c594ea96db15e5df50a24f06b4 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Prevent zoom-out beyond infinite linear max double valuesKeith Kyzivat2020-10-221-0/+1
| | | | | | | | | | | | | | | When zooming out domains that include log axes, prevent zoom-out when the new zoom level would result in a max value that is above the upper range of double (represented as inf). Additionally, prevent zoom-out when the log value exceeds the number of pixels in the log axis dimension. Major gridlines are created at each integral log value, and it does not make sense to zoom out beyond such point. Task-number: QTBUG-75500 Change-Id: Icab72f600a84297d43da675c5757f6e63ae25119 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Doc: Set QChart functions as deprecatedTopi Reinio2019-03-051-3/+16
| | | | | | | | | | | axisX,Y and setAxisX,Y functions are now deprecated - mark them as such in the documentation. Example code was also fixed to not use deprecated functions, but example documentation was not updated to reflect that change. Task-number: QTBUG-74097 Change-Id: I2d4f283f1d0c62a02b33c373885e75bce34a1114 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix the inclusion of MOC files before QT_CHARTS_END_NAMESPACEJesus Fernandez2019-01-211-2/+2
| | | | | | | Change-Id: Id4d50a674db619f15f8e9d05c663f2b83bb8b7e5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Clarify the impact of a zoom to propertiesMaurice Kalinowski2018-11-151-0/+2
| | | | | | | | | Using zoomIn will modify values of other items. In case a user is aiming at having those fixed, this needs to be taken care of manually. Task-number: QTBUG-71529 Change-Id: I93e799bf4fc67b563e93df616090aa1dc7acf691 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-06-301-1/+1
|\ | | | | | | Change-Id: If1c0e127a27ab2cd954da6fdf6b9f5e214fd01ae
| * Doc: Rename C++ module from 'Qt Charts' to 'QtCharts'Topi Reinio2018-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | This is the convention for documentating Qt C++ modules. It has no effect on the user-visible output except for the html file name, while avoiding certain problem for external tools such as PySide/Shiboken. Change-Id: Ibaec4f8a05ef34bf8a8aff2c9695f859f24858db Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Add support for setting a plotarea rectAndy Shaw2018-05-181-1/+8
|/ | | | | Change-Id: Iaa5cee58382b8290a7e36fd744a8af8bc29515b9 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Doc: Edit QChart docsLeena Miettinen2017-01-161-76/+128
| | | | | Change-Id: Icd3e0058f7974924e6ccff31192e8df5eb6a8666 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Updated licenseMiikka Heikkinen2016-01-131-9/+17
| | | | | | Change-Id: I7ad9838039b56b9e3a7fe2c42a2d8ff818f393fb Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* Updated license headersTitta Heikkala2015-10-201-11/+14
| | | | | Change-Id: Ic72ee3c9723c2b3f3368c79219b7468f5d95aa84 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* Added possibility to set duration and easing curve for chart animationTitta Heikkala2015-09-111-0/+30
| | | | | | | | | Changed the animation API so that it's possible to change the duration and easing curve of the chart animation. Change-Id: I2ab3e0664a7f30bc2bb7085daa1d97181edb90ba Task-number: QTRD-3496 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* Fix documentation typoMiikka Heikkinen2015-08-101-1/+1
| | | | | Change-Id: Ibc5b1f403f143eddc49a8aeeedd9de4145825b94 Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
* Copyright header changesTitta Heikkala2015-04-231-3/+3
| | | | | | | Copyright header changes for Qt 5.5. Change-Id: I2b8e9356997de2c87a7436bcefd4d0948d566259 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* Remove deprecated elements from APIs.Miikka Heikkinen2014-11-121-20/+0
| | | | | | | Task-number: QTRD-2098 Change-Id: Ib658c8a51af0b73ded5d6b13c8fa58762f859961 Reviewed-by: Mika Salmela <mika.salmela@theqtcompany.com> Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
* Updated license headersTitta Heikkala2014-11-121-9/+7
| | | | | | | Updated new license headers and added missing ones to qdoc files. Change-Id: I9f2af2a8b44c3ebf19fd494628dfaa8775a47b06 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* Plugged some memory leaks.Miikka Heikkinen2014-11-111-0/+1
| | | | | | | | | | | Autotests were also made Valgrind friendly by adding a final one millisecond wait to the end of the test to allow pending deleteLaters to run. Also some minor cosmetic cleanup done to autotests. Change-Id: Ic3719167a22949f243eaf54614e174a681dbe34a Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
* Added plotAreaChanged signal to chart.Miikka Heikkinen2014-10-211-4/+7
| | | | | | | | | | The plotArea property was also introduced, though it was previously available via getter function. The signal with same name on QML side was linked to the new signal. Task-number: QTRD-3330 Change-Id: I8d985762194800e1b8743d0a7429ef4d0356bd98 Reviewed-by: Mika Salmela <mika.salmela@theqtcompany.com>
* Fix include syntaxTitta Heikkala2014-10-201-11/+11
| | | | | | | | | The includes for the whole project are changed to syntax: '#include <module/class> Change-Id: If32f8b6c3f47516ad6bc30ed40789ea9042d5664 Task-number: QTRD-3373 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
* Qt Charts project file structure changeTitta Heikkala2014-10-141-0/+872
Charts repository structure is changed to follow the structure of a Qt Add-On module. The task includes following changes: - All macros and definitions named 'commercial' have been renamed. - Compile errors related to QString and qSort usage have been fixed. - Old demos are moved under examples. The QML examples now support only Qt Quick 2.0, the support for Qt Quick 1 is removed. - The QML examples with multiple views are updated so that they are usable also with touch devices. - Unnecessary version checks are removed from examples. - The build stamp has been removed as it was only meant for Charts development purposes and it's no longer needed. Also development build related debug prints are removed as __DATE__ can't be used for all OS thus it doesn't make much sense. - Documentation structure has been updated based on the new module structure. The raw HTML files have been removed. Demos are combined to examples. - Unnecessary .qdocinc files are no longer needed. The content is moved to the corresponding .cpp files. - The Charts widget designer plugin is updated according to the module change. - The test cases updated according to the project structure change. Tests are added also for version 2.0. - cmake modules generation is not needed with Qt 5.4 and Qt Charts so it's disabled. - The new module name and version are updated to the plugin.qmltypes file. Task-number: QTRD-2844, QTRD-3217, QTRD-3218, QTRD-3277, QTRD-3228, QTRD-2526, QTRD-3233, QTRD-3222 Change-Id: Ib7fb26057cde710ffaf6bc780c8bf52a16f45160 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>