  We study polynomial-type solutions of the $q$-Heun equation, which is related
with quasi-exact solvability. The condition that the $q$-Heun equation has a
non-zero polynomial-type solution is described by the roots of the spectral
polynomial, whose variable is the accessory parameter $E$. We obtain sufficient
conditions that the roots of the spectral polynomial are all real and distinct.
We consider the ultradiscrete limit to clarify the roots of the spectral
polynomial and the zeros of the polynomial-type solution of the $q$-Heun
equation.
