based on qt code