Fork from https://sourceforge.net/p/qtrpt/