The Qing dynasty formed after what event?