Skip to content
  • 0 Votes
    5 Posts
    84 Views
    N
    Thanks, solution found, similar to what you are suggesting. I dug a bit further into Qt docs and found the entry for setPointsConfiguration, which takes data in the form of QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> So my new code for setting the colors looks like: QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> ptsConfig; QList<BrthPosnPlots>::iterator brthItr = m_brthPosns.begin(); MultiLineSeries *thisSrs = GetLineSeries(srs); QList<QPointF> srspts = thisSrs->points(); quint32 ctSrs = srspts.size(); if ((ctSrs < 1)) return; qsizetype bpos; for (brthItr = m_brthPosns.begin(); brthItr != m_brthPosns.end(); brthItr++) { if ((*brthItr).GetEEPos() > ctSrs) continue; if (((*brthItr).GetEIPos() > 1) && ((*brthItr).GetEEPos() > (*brthItr).GetEIPos() + 5)) { for (bpos = (*brthItr).GetEIPos(); bpos < (*brthItr).GetEEPos(); bpos++) { ptsConfig.insert_or_assign(bpos, conf); // thisSrs->setPointConfiguration(bpos, conf); } } } if (!ptsConfig.isEmpty()) { thisSrs->setPointsConfiguration(ptsConfig); } The speedup is truly amazing! From over 2 sec down to < 20 msec for this method. Thanks to all for feedback and tips.