If a QListView's model is reset to an empty one, its columnCount()
below the root is going to be 0. Therefore, the code was doing a
qBound(0, d->column, -1)
which is meaningless (high < low). Instead, do the two logical
operations explicitly: first do an upper bound on d->column
(using qMin) and then lower bound the result by 0 (using qMax).
The code worked by chance, because 0 was eventually the correct
number to use as a bound for d->column.
Change-Id: Ic32077cdab01eaa715137c05ed1f9d66c8eb2f67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>