Exemplo n.º 1
0
void TreeView::ExpandToIndex(const QModelIndex &ind)
{
    if(ind.parent().isValid()){
        // Expand my parent's parent before expanding my parent
        ExpandToIndex(ind.parent());
        expand(ind.parent());
    }
}
Exemplo n.º 2
0
	void Polynom::SetCoef(int ind, double val)
	{
		if (ind < 0) { // TODO : dublicated code
			assert(!"Polynom::SetCoef : negative index");
			return;
		}
		if (ind > Power() && val == 0.0)
			return;

		ExpandToIndex(ind);
		m_coef[ind] = val;
	}
Exemplo n.º 3
0
	void Polynom::SetCoefNZ(int ind, double val) // TODO : delete function?
	{
		if (ind < 0)
		{
			assert(!"Polynom::SetCoef : negative index");
			return;
		}

		if (ind > Power() && AlmostZero(val))
			return;

		ExpandToIndex(ind);
		m_coef[ind] = val;
		DeleteTopZeros();
	}