On the formation of hot DQ white dwarfs