kdab / kdchart Goto Github PK
View Code? Open in Web Editor NEWA Qt tool for creating business and scientific charts. This is the canonical repository for KDChart.
Home Page: https://www.kdab.com/kd-chart/
License: Other
A Qt tool for creating business and scientific charts. This is the canonical repository for KDChart.
Home Page: https://www.kdab.com/kd-chart/
License: Other
Steps to reproduce:
Run valgrind ./bin/LeveyJenningsSimple-example
Result:
==220254== Invalid read of size 8
==220254== at 0x4959143: KDChart::Chart::Private::paintAll(QPainter*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1093)
==220254== by 0x495A5C9: KDChart::Chart::paintEvent(QPaintEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1410)
==220254== by 0x4CFD5DD: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x495D0AB: KDChart::Chart::event(QEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1768)
==220254== by 0x4CBA782: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x5C027B9: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254== by 0x4CF5539: QWidgetPrivate::sendPaintEvent(QRegion const&) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x4CF5D61: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x4CF71C2: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x4CF6FE1: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x4CF6FE1: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x4CF5A7B: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== Address 0x17fad360 is 0 bytes inside a block of size 96 free'd
==220254== at 0x484584F: operator delete(void*) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==220254== by 0x4955EB9: KDChart::Chart::Private::slotLayoutPlanes() (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:652)
==220254== by 0x5C3A5FF: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254== by 0x49CE3A2: KDChart::LeveyJenningsAxis::paintAsAbscissa(KDChart::PaintContext*) (src/kdab/KDChart/src/KDChart/Cartesian/KDChartLeveyJenningsAxis.cpp:210)
==220254== by 0x49A3AB2: KDChart::CartesianAxis::paint(QPainter*) (src/kdab/KDChart/src/KDChart/Cartesian/KDChartCartesianAxis.cpp:553)
==220254== by 0x4970D2C: KDChart::AbstractArea::paintAll(QPainter&) (src/kdab/KDChart/src/KDChart/KDChartAbstractArea.cpp:130)
==220254== by 0x495914E: KDChart::Chart::Private::paintAll(QPainter*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1093)
==220254== by 0x495A5C9: KDChart::Chart::paintEvent(QPaintEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1410)
==220254== by 0x4CFD5DD: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x495D0AB: KDChart::Chart::event(QEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1768)
==220254== by 0x4CBA782: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x5C027B9: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254== Block was alloc'd at
==220254== at 0x4842FB3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==220254== by 0x49568CF: KDChart::Chart::Private::slotLayoutPlanes() (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:951)
==220254== by 0x5C3A5FF: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254== by 0x4958BC2: KDChart::Chart::Private::updateDirtyLayouts() (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1057)
==220254== by 0x4959067: KDChart::Chart::Private::paintAll(QPainter*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1079)
==220254== by 0x495A5C9: KDChart::Chart::paintEvent(QPaintEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1410)
==220254== by 0x4CFD5DD: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x495D0AB: KDChart::Chart::event(QEvent*) (src/kdab/KDChart/src/KDChart/KDChartChart.cpp:1768)
==220254== by 0x4CBA782: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x5C027B9: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.2)
==220254== by 0x4CF5539: QWidgetPrivate::sendPaintEvent(QRegion const&) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
==220254== by 0x4CF5D61: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.2)
Problem:
The member planeLayoutItems
gets modified during iteration over it inside the Chart::Private::paintAll
method.
This must be a longer term issue. It doesn't seem to be related to the recent Qt 6 port of KDChart (checked by reverting the code base to the previous state).
I found out that in KDGantt\kdganttdatetimegrid.cpp /.h there is not support for minutes and seconds scale. Is it possible to add this feature in the future versions? Thanks!
How to reproduce the bug:
if (idx.column() == 0) {
switch (role) {
case Qt::SizeHintRole:
return QSize(100, 60);
Fix:
There are two paths to update the Gantt items (which is bad). The faulty path (GraphicsScene::updateItems()) does not take in account the row size:
Replace:
item->updateItem(Span(item->pos().y(), item->rect().height()), idx);
With:
const QModelIndex sidx = summaryHandlingModel()->mapToSource(idx);
Span rg = rowController()->rowGeometry(sidx);
item->updateItem(rg, idx);
When using CMake's FetchContent, the compiler cannot get a path to the kdablibfakes/include directory.
The issue arises due to "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/kdablibfakes/include>"
line (Ln 472) in src/CMakeLists.txt file.
One possible solution is to get the path via get_filename_component
, e.g. get_filename_component(my_var ../ ABSOLUTE)
and then use it instead of the Ln 472, that is:
"$<BUILD_INTERFACE:${my_var}/kdablibfakes/include>"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.