mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Profile: clear tooltip's plotInfo in ProfileWidget2::setEmptyState
The tooltip's plotInfo was not cleared when clearing the profile. With the new cylinder code, this lead to crashes, because the displayed_dive's cylinder array is now cleared. The old code would happily read stale data from the fixed-size cylinders array. Clear the plotInfo explicitly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									12c7c5ea96
								
							
						
					
					
						commit
						f0a89759bf
					
				
					 3 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -139,7 +139,7 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent),
 | 
			
		|||
	timeAxis(0),
 | 
			
		||||
	lastTime(-1)
 | 
			
		||||
{
 | 
			
		||||
	memset(&pInfo, 0, sizeof(pInfo));
 | 
			
		||||
	clearPlotInfo();
 | 
			
		||||
	entryToolTip.first = NULL;
 | 
			
		||||
	entryToolTip.second = NULL;
 | 
			
		||||
	setFlags(ItemIgnoresTransformations | ItemIsMovable | ItemClipsChildrenToShape);
 | 
			
		||||
| 
						 | 
				
			
			@ -223,6 +223,11 @@ void ToolTipItem::setPlotInfo(const plot_info &plot)
 | 
			
		|||
	pInfo = plot;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ToolTipItem::clearPlotInfo()
 | 
			
		||||
{
 | 
			
		||||
	memset(&pInfo, 0, sizeof(pInfo));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ToolTipItem::setTimeAxis(DiveCartesianAxis *axis)
 | 
			
		||||
{
 | 
			
		||||
	timeAxis = axis;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,6 +44,7 @@ public:
 | 
			
		|||
	void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
 | 
			
		||||
	void setTimeAxis(DiveCartesianAxis *axis);
 | 
			
		||||
	void setPlotInfo(const plot_info &plot);
 | 
			
		||||
	void clearPlotInfo();
 | 
			
		||||
	void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
 | 
			
		||||
public
 | 
			
		||||
slots:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1134,6 +1134,7 @@ void ProfileWidget2::setEmptyState()
 | 
			
		|||
	ccrsensor3GasItem->setVisible(false);
 | 
			
		||||
	ocpo2GasItem->setVisible(false);
 | 
			
		||||
#ifndef SUBSURFACE_MOBILE
 | 
			
		||||
	toolTipItem->clearPlotInfo();
 | 
			
		||||
	toolTipItem->setVisible(false);
 | 
			
		||||
	diveCeiling->setVisible(false);
 | 
			
		||||
	decoModelParameters->setVisible(false);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue