According to Tim Paterson's blog and Paul Allen autobiography, MS bought SCP's QDOS on 1981 July 27 (MS had a non-exclusive license for QDOS to sell to OEMs). This is before the IBM PC release in August.
see https://web.archive.org/web/20190722012644/http://www.paters...
That was the year after MS initially licensed it.
MS did buy it eventually, but not immediately.