Blank texts break axes login in GenericPlot

.. for some reason in earlier version of Qt Charts there are errant
   items in the same area as the axes that are blank, these break
   the code that derives the axes rectangles in Qt Charts <= 5.10
This commit is contained in:
Mark Liversedge
2020-02-29 16:47:50 +00:00
parent c81576e311
commit ec24536f65

View File

@@ -271,6 +271,9 @@ GenericPlot::plotAreaChanged()
foreach(QGraphicsItem *item, qchart->scene()->items(zone, Qt::ItemSelectionMode::ContainsItemShape)) {
if (item->type() != QGraphicsTextItem::Type) continue;
// for some reason 5.10 or earlier has errant text items we should ignore
if (static_cast<QGraphicsTextItem*>(item)->toPlainText() == "") continue;
// is this an axis title?
QAbstractAxis *found=NULL;
foreach(QAbstractAxis *axis, qchart->axes()) {