mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 21:20:31 -05:00 
			
		
		
		
	RollupWidget: fixed segfault in restoreState by swapping loops
This commit is contained in:
		
							parent
							
								
									ebd5216917
								
							
						
					
					
						commit
						c2db32201f
					
				@ -89,11 +89,11 @@ void RollupWidget::saveState(RollupState &state) const
 | 
			
		||||
    QList<RollupState::RollupChildState>& childrenStates = state.getChildren();
 | 
			
		||||
    childrenStates.clear();
 | 
			
		||||
 | 
			
		||||
    for (int i = 0; i < children().count(); ++i)
 | 
			
		||||
    for (const auto &child : children())
 | 
			
		||||
    {
 | 
			
		||||
        QWidget* r = qobject_cast<QWidget*>(children()[i]);
 | 
			
		||||
        QWidget* r = qobject_cast<QWidget*>(child);
 | 
			
		||||
 | 
			
		||||
        if (r) {
 | 
			
		||||
        if (r && isRollupChild(r)) {
 | 
			
		||||
            childrenStates.push_back({r->objectName(), r->isHidden()});
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@ -161,15 +161,15 @@ void RollupWidget::restoreState(const RollupState& state)
 | 
			
		||||
{
 | 
			
		||||
    const QList<RollupState::RollupChildState>& childrenStates = state.getChildren();
 | 
			
		||||
 | 
			
		||||
    for (const auto &object : children())
 | 
			
		||||
    {
 | 
			
		||||
        QWidget* r = qobject_cast<QWidget*>(object);
 | 
			
		||||
 | 
			
		||||
        if (r && isRollupChild(r))
 | 
			
		||||
        {
 | 
			
		||||
            for (const auto &childState : childrenStates)
 | 
			
		||||
            {
 | 
			
		||||
        for (int j = 0; j < children().count(); ++j)
 | 
			
		||||
        {
 | 
			
		||||
            QWidget* r = qobject_cast<QWidget*>(children()[j]);
 | 
			
		||||
 | 
			
		||||
            if (r)
 | 
			
		||||
            {
 | 
			
		||||
                if (r->objectName() == childState.m_objectName)
 | 
			
		||||
                if (childState.m_objectName.compare(r->objectName()) == 0)
 | 
			
		||||
                {
 | 
			
		||||
                    if (childState.m_isHidden) {
 | 
			
		||||
                        r->hide();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user