random select, can avoid repetition. implemented in Qt