summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add bar chart exampleAndrii Staikov2021-08-307-1/+319
| | | | | | | | | | | | Example shows using setBarSelected(). Selecting bars changes their color and information of selected/unselected bars. [QtCharts][Example] Added Example Task-number: QTBUG-89445 Change-Id: Ic863e763d2cfa552629f42afd1232c1f77b95e95 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> (cherry picked from commit 72d69b22d8da004fcb27e1a549cdda3f52b9c4af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1749-49/+49
| | | | | | | | Task-number: QTBUG-95636 Change-Id: I2ae5ba6164cb5ed450c8924d484d30167461c10d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 76fcbad6f08e490865c362ec02c02b13800c37cc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update Qt Charts legend example to illustrate interactivityKeith Kyzivat2021-06-082-128/+171
| | | | | | | | | Example cleaned up and organized, and interactive checkbox is added to allow user to see how an interactive legend works. Task-number: QTBUG-93477 Change-Id: I855283ad8fffd61b23cf021ab41530255abfbd47 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Do not compile multimedia exampleMichal Klocek2021-06-032-2/+3
| | | | | | | | | | This example needs to be fixed when new multimedia apis are in. Skip example for now since it blocks qt5 integration with new multimedia api. Task-number: QTBUG-94181 Change-Id: I6e993f3340e71020f434bd198cd0b5574f6f7b2d Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix QML ScatterSeries exampleAlbert Astals Cid2021-02-231-1/+1
| | | | | | | | | The text says "The following QML code shows how to create a chart with two simple scatter series:", so include the 2 series, otherwise looks strange Change-Id: Iab848dff8657a7815b9e12ce8f4ce3d07e14b757 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix qmloscilloscope example for Qt 6Miikka Heikkinen2021-01-195-53/+66
| | | | | | | | | | | OpenGL acceleration of series only works when OpenGL backend is used, so added detection for that and also provided instruction how to force it on. Removed Quick Controls v1 usage as it's no longer supported in Qt 6. Change-Id: I169f4b1cfeb33dded4b6a51c34cd35daf189954f Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix qmlf1legends example for Qt 6Miikka Heikkinen2021-01-145-124/+114
| | | | | | | | | | QtQuick.XmlListModel is no longer available in Qt 6, as it was provided by QtXmlPatterns module, which is no longer available. Replaced it with simply ListModel. Change-Id: I06d8c2253df40a8cfea608647b2d3429ee9c1fa6 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add cmake buildMichal Klocek2021-01-0651-0/+2306
| | | | | | Task-number: QTBUG-89091 Change-Id: Ie511e6bc262f197b2c21e52ec7696a0d50e06d18 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use qtConfig, prepare for cmake 1/2Michal Klocek2020-11-161-1/+1
| | | | | | | | Use qtConfig for opengl otherwise cmake support scripts will not handle it. Change-Id: I5a52ce91cd81ff82eca6e8d6c8b9e371a5294ec8 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Remove charts namespace for Qt6Michal Klocek2020-11-0675-95/+95
| | | | | | | | | 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>
* Add datetimeaxis to configure systemMichal Klocek2020-11-061-5/+3
| | | | | | | This handles also qreal as float detection. Change-Id: I6b975f487f4d244849c306a703e5f25172acec8e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add configure systemMichal Klocek2020-11-051-40/+64
| | | | | | | | | Adds configure system to charts. Make basic types as configure features. By default build all types. Change-Id: I00992555de377589cb522d471ad81f30499f93f3 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Avoid initializing QFlags with 0Keith Kyzivat2020-10-221-1/+1
| | | | | | | It is deprecated. Change-Id: Icb4f0d3a5e563c9d57aef2816f631b20f290291a Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Check anchor before painting calloutXu Yanghe2020-08-211-1/+1
| | | | | | | | | | QChart::mapToPosition return QPointF including decimal, like QPointF(-0.0265625,542.875).Then anchor became wrong,and paint callout in left bottom corner. Judge m_anchor before paint callout.If m_anchor is null, discarding painting callout. Fixes: QTBUG-86036 Change-Id: I09246195c5ffe37573464d6a4f68cb7ea06c21f6 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix removed calls to insertMultiMichal Klocek2020-08-144-6/+6
| | | | | | | Use QMultiMap, QMulitHash instead. Change-Id: I0782aa189a4465619757cb8204189bda888d641a Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-265-9/+9
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I0d9e3a48056294137f1465f091802b4b7c32c8bf Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notice the following API changes: -void QXYSeries::replace(QVector<QPointF> points); +void QXYSeries::replace(const QList<QPointF> &points); -bool QAbstractBarSeries::append(QVector<QBarSet *> sets); +bool QAbstractBarSeries::append(const QList<QBarSet *> &sets); -void QAbstractBarSeries::barsetsAdded(QVector<QBarSet *> sets); +void QAbstractBarSeries::barsetsAdded(const QList<QBarSet *> &sets); -void QAbstractBarSeries::barsetsRemoved(QVector<QBarSet *> sets); +void QAbstractBarSeries::barsetsRemoved(const QList<QBarSet *> &sets); -bool QBoxPlotSeries::append(QVector<QBoxSet *> boxes); +bool QBoxPlotSeries::append(const QList<QBoxSet *> &boxes); -bool QBoxPlotSeries::append(QVector<QBoxSet *> boxes); +bool QBoxPlotSeries::append(const QList<QBoxSet *> &boxes); -void QBoxPlotSeries::boxsetsAdded(QVector<QBoxSet *> sets); +void QBoxPlotSeries::boxsetsAdded(const QList<QBoxSet *> &sets); -void QBoxPlotSeries::boxsetsRemoved(QVector<QBoxSet *> sets); +void QBoxPlotSeries::boxsetsRemoved(const QList<QBoxSet *> &sets); -bool QPieSeries::append(QVector<QPieSlice *> slices); +bool QPieSeries::append(const QList<QPieSlice *> &slices); -QPieSlice *QPieSeries::append(QString label, qreal value); +QPieSlice *QPieSeries::append(const QString &label, qreal value); -void QPieSeries::added(QVector<QPieSlice *> slices); +void QPieSeries::added(const QList<QPieSlice *> &slices); -void QPieSeries::removed(QVector<QPieSlice *> slices); +void QPieSeries::removed(const QList<QPieSlice *> &slices); These should be source compatible changes. Task-number: QTBUG-84469 Change-Id: I153796e9d8244c8e22819993ef26aa91e7b71f99 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use QList instead of QVector in qtcharts examplesJarek Kobus2020-06-2310-25/+25
| | | | | | Task-number: QTBUG-84469 Change-Id: I724c4d793294d890e26ff7d39021bbdc9438e978 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-04-064-8/+14
|\
| * Use Qt::SplitBehavior in preference to QString::SplitBehaviorv5.15.0-beta4v5.15.0-beta3v5.15.0-beta2Edward Welbourne2020-03-023-3/+3
| | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: Ib453ad87f72f84e2d44cdf89a614abdc60651432 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Examples: add scrollbar to allow viewing all settings on AndroidAssam Boudjelthia2020-02-241-5/+11
| | | | | | | | | | | | | | | | | | | | This fix is most relevant for Android, currently, if the screen size is small the settings will show cramped and not usable. Thus, adding a scrollbar to fix that. Task-number: QTBUG-80717 Change-Id: Icafd5f108191990c8bbdf5ab21049e07bb40cecb Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* | Update dependenciesFriedemann Kleint2020-04-064-16/+10
|/ | | | | | | | | qtbase: Adapt to OpenGL split (a64f4b405222527a72fb087226801c52ddf54ef0), add missing Q_MOC_INCLUDE, adapt examples to changed signals. Task-number: QTBUG-74273 Change-Id: I96b7bb67c0403e3aa72debe16fd9965c70f5c806 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid initializing QFlags with 0 or nullptrFriedemann Kleint2019-11-256-6/+6
| | | | | | | It is being deprecated. Change-Id: I1eafbce147e05028c93830bb882611d9eea58586 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-021-2/+4
|\ | | | | | | Change-Id: I63ae7b0300c441821be3043d5a7a3621f3582cca
| * Fix deprecation warnings about QtCharts::setAxisX(), setAxisY()Friedemann Kleint2019-05-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use new API, fixing warnings like: tst_qchart.cpp:343:34: warning: 'void QtCharts::QChart::setAxisX(QtCharts::QAbstractAxis*, QtCharts::QAbstractSeries*)' is deprecated [-Wdeprecated-declarations] ... tst_qchart.cpp:361:34: warning: 'void QtCharts::QChart::setAxisY(QtCharts::QAbstractAxis*, QtCharts::QAbstractSeries*)' is deprecated [-Wdeprecated-declarations] ... Some test appear to be relying on the axes being removed in a certain order. Change-Id: I86fab08d661afcd1087a55f847133a9e90d758f9 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* | Fix some deprecation warningsv5.13.0-alpha1Friedemann Kleint2019-02-061-1/+3
|/ | | | | | | | | | xychart/qxyseries.cpp:1025:50: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] areachart/areachartitem.cpp:281:58: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] areachart/areachartitem.cpp:299:58: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] declarativecategoryaxis.cpp:86:57: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QList<QPair<QString, double> >::iterator; LessThan = bool (*)(const QPair<QString, double>&, const QPair<QString, double>&)]’ is deprecated: Use std::sort [-Wdeprecated-declarations] Change-Id: I0d7705be8690405a439e18ea0ddbfaef433037a4 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add proper 'deprecated' warningsMichal Klocek2018-04-3024-91/+159
| | | | | | | | | | | | | | Use Q_DECL_DEPRECATED to mark deprecated API. Fix examples to do not use deprecated functions. These functions were 'marked' as deprecated when multiple axes were introduced. Moreover, axis X/Y is an ambiguous term and not necessary mean Horizontal/Vertical axis. These deprecated methods also create an issue when given series should be attached to several Horizonal/ Vertical axes and calling them can cause unwanted results. Change-Id: I639e1b964240b80c2b3b93b74b061da324bca1ff Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* qmlchart example: Anchor content to window sizev5.11.0-beta4Oliver Wolff2018-04-101-0/+1
| | | | | | | | Without the anchor the example breaks as soon as the window is resized. Change-Id: I6476d8891745e969c06d3e943e8067f5e2191350 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Polish the audio exampleFriedemann Kleint2018-02-085-42/+60
| | | | | | | | | | | | - Use C++ 11 (nullptr, override) - Bail out cleanly if there is no audio input available - Rewrite the buffer algorithm to work on a member variable to make the slidling window principle clearer and reduce QVector allocations Task-number: QTBUG-60662 Change-Id: I02827f3dca4f0bf1fb213fa12369455de6c618c5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-124-0/+4
| | | | | | Task-number: QTBUG-53141 Change-Id: Ifa8999bb06fee1d6f768f08e4df8e6c47b977629 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Update to new QRandomGenerator APIThiago Macieira2017-11-0310-15/+15
| | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Revamp QML Charts examplev5.10.0-beta2v5.10.0-beta1Titta Heikkala2017-09-134-22/+15
| | | | | | | | | | Updated the example so that the same theme is used for all charts. The images for documentation are also updated. Added comments to code. Change-Id: Iaad648f42f5bb7edfa101f1202b56472aa511ca3 Task-number: QTBUG-60662 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add .ui.qml file to Qml Charts Examplev5.10.0-alpha1Titta Heikkala2017-09-083-52/+92
| | | | | | | | | MainForm.ui.qml file added to Qml Charts Example to make it work with Qt Quick Designer. Change-Id: I709dd460ac179b5d65db0ca29196351c89ade5eb Task-number: QTBUG-60662 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Improve the documentation of Chart Themes ExampleTitta Heikkala2017-09-061-2/+24
| | | | | | | | | | | Added more detailed documentation and code snippets to Chart Themes Example. Change-Id: I206b65038b369d0eaa5fb128b872328ec43de7a2 Task-number: QTBUG-60662 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update appearance of Chart Themes ExampleTitta Heikkala2017-09-051-20/+46
| | | | | | | | | Default ranges are set to axes. Only one pie chart is shown. Space added to y-axis labels to add space between labels and axis. Change-Id: If64f68aad90ed9c3151b4cbfe7c4fa527871fb70 Task-number: QTBUG-60662 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add Qt Designer UI file to Chart Themes ExampleTitta Heikkala2017-09-044-81/+155
| | | | | | | | | Add a UI file to Chart Themes Example. The UI file includes widgets to change chart options along with signal slot connections. Change-Id: I194624e23ebb785271a054cf1b2891d134fd2656 Task-number: QTBUG-60662 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix window palette initialization in Chart Themes ExampleTitta Heikkala2017-08-301-27/+35
| | | | | | | | | The default window palette needs to be set to the application object in initialization as the palette of the window is not valid by then. Change-Id: Iad18c255600b31b18f0030094dd9e57757001fa1 Task-number: QTBUG-62824 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Set window palette in Chart Themes ExampleTitta Heikkala2017-08-301-27/+27
| | | | | | | | | Set the right colors for window palette based on theme in Chart Themes Example to help test automation. Change-Id: Ia7ed7fc05fc5193a916ebff29bba8aeceda5f97f Task-number: QTBUG-62824 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-1526-150/+216
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/charts/dynamicspline/chart.cpp examples/charts/piechartdrilldown/main.cpp Change-Id: I839e97bf377c7823f2f464c097656d58f279ed77
| * Use range-for instead of foreach in examplesMiikka Heikkinen2017-08-1113-53/+58
| | | | | | | | | | | | | | | | Task-number: QTBUG-60662 Change-Id: Ief9264e2b6670466bd74278dbd194a7be81d614f Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
| * Minor coding style fixes to examplesMiikka Heikkinen2017-08-0319-97/+158
| | | | | | | | | | | | | | | | Task-number: QTBUG-60662 Change-Id: I0edd88328b403d09faa27d30b89ac91c802121dc Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* | Use QRandomGenerator instead of q?randThiago Macieira2017-07-0411-33/+25
| | | | | | | | | | Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Be (somewhat more) consistent about the value of piEdward Welbourne2017-06-143-6/+4
| | | | | | | | | | | | | | | | | | Use M_PI in C++ and Math.PI in JavaScript (including QML). Use qmath.h's value for M_PI where we can't avoid an explicit value. Task-number: QTBUG-58083 Change-Id: I80c81444c1867f8f0c07f192fa68de933f48bbc4 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* | Use qDegreesToRadians() more widelyEdward Welbourne2017-02-241-1/+1
|/ | | | | | | | It documents intent more clearly (and saves us a hand-rolled value for pi). Task-number: QTBUG-58083 Change-Id: I34871ad8526087aa892afdcc85b362bc7442bad1 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add minor ticks support for QLogValueAxisAlexander Mishin2016-12-161-13/+14
| | | | | | | | | | | | | | | | - added QLogValueAxis::minorTickCount property - added QLogValueAxis::tickCount property (read-only) - added logarithmically distributed minor ticks for VerticalAxis - added logarithmically distributed minor ticks for HorizontalAxis - added logarithmically distributed minor ticks for PolarChartAxisAngular - added logarithmically distributed minor ticks for PolarChartAxisRadial - updated example for QLogValueAxis - added tickCount and minorTickCount properties documentation for QLogValueAxis Task-number: QTBUG-51612 Change-Id: I92a0af81f741e7b2ba871a64f801176399b9e9a5 Reviewed-by: Alexander Mishin <apmishin@yandex.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add a possibility to change legend marker shapeMiikka Heikkinen2016-09-231-6/+5
| | | | | | | | | | | It is now possible to choose between rectangular, circular, and "from series" shapes for legend markers. The "from series" shape uses scatter dot items as legend markers in case of scatter series and a line segment for line and spline series. Task-number: QTBUG-50682 Change-Id: I58977ead88e1274e1f163516d32c4d290f4410f9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-0655-374/+503
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: examples/charts/charts.pro src/charts/glwidget.cpp src/chartsqml2/declarativechart.cpp src/chartsqml2/declarativeopenglrendernode.cpp tests/auto/auto.pro Change-Id: If909b4b13844c474bf4898a66ee01ac111d0a248
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-234-9/+29
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf README src/charts/qchartglobal.h tests/auto/chartdataset/tst_chartdataset.cpp tests/auto/domain/tst_domain.cpp Change-Id: Ib4e01f2646d87b691c7b2f8bee4ed1f5521e4f6d
| | * Fix resize handling in Callout exampleMiikka Heikkinen2016-08-164-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Callouts are now positioned correctly when the chart is resized. Task-number: QTBUG-54492 Change-Id: I5660eb48e58348cc2d649b48965c342488294ae4 Reviewed-by: Mika Salmela <mika.salmela@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-1149-358/+462
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/charts/glwidget.cpp src/charts/xychart/glxyseriesdata_p.h src/chartsqml2/declarativerendernode.cpp Change-Id: I611ff3a7874ceb7dddcf0f4d069927a9899a986d