Qt Markov chain implementation.