Qt5: fixed crash in PdfPlotCurve::setData()
This commit is contained in:
parent
55b47aa95d
commit
8b711782fd
@ -1425,6 +1425,7 @@ void MainWindow::update(const cv::Mat & image)
|
||||
|
||||
|
||||
//update likelihood plot
|
||||
UDEBUG("Set likelihood score curve values (%d)", scores.size());
|
||||
likelihoodCurve_->setData(scores, QMap<int, int>());
|
||||
QMap<int, int> inlierScores;
|
||||
for(QMap<int, int>::iterator iter=scores.begin(); iter!=scores.end(); ++iter)
|
||||
@ -1444,6 +1445,7 @@ void MainWindow::update(const cv::Mat & image)
|
||||
}
|
||||
inlierScores.insert(iter.key(), maxValue);
|
||||
}
|
||||
UDEBUG("Set inliers score curve values (%d)", inlierScores.size());
|
||||
inliersCurve_->setData(inlierScores, QMap<int, int>());
|
||||
if(ui_->likelihoodPlot->isVisible())
|
||||
{
|
||||
|
||||
@ -20,8 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "PdfPlot.h"
|
||||
|
||||
#define ULOGGER_DEBUG(A, ...)
|
||||
#include "find_object/utilite/ULogger.h"
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@ -145,15 +144,14 @@ void PdfPlotCurve::setData(const QMap<int, int> & dataMap, const QMap<int, int>
|
||||
|
||||
// update values
|
||||
QList<QGraphicsItem*>::iterator iter = _items.begin();
|
||||
QMap<int, int>::const_iterator j=weightsMap.begin();
|
||||
for(QMap<int, int>::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i, ++j)
|
||||
for(QMap<int, int>::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i)
|
||||
{
|
||||
((PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), j!=weightsMap.end()?j.value():-1);
|
||||
UASSERT(iter!= _items.end());
|
||||
((PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), weightsMap.value(i.key(),-1));
|
||||
//2 times...
|
||||
++iter;
|
||||
++iter;
|
||||
}
|
||||
|
||||
//reset minMax, this will force the plot to update the axes
|
||||
this->updateMinMax();
|
||||
Q_EMIT dataChanged(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user