  Quantum anomalous Hall effect (QAHE) is a fundamental quantum transport
phenomenon in condensed matter physics. Until now, the only experimental
realization of the QAHE has been observed for Cr/V-doped (Bi,Sb)$_2$Te$_3$ but
at extremely low observational temperature, thereby limiting its potential
application in dissipationless quantum electronics. Employing first-principles
calculations, we study the electronic structures of graphene codoped with
5\textit{d} transition metal and boron (B) atoms based on a compensated
\textit{n}--\textit{p} codoping scheme. Our findings are as follows. 1) The
electrostatic attraction between the \textit{n}- and \textit{p}-type dopants
effectively enhances the adsorption of metal adatoms and suppresses their
undesirable clustering. 2) Hf--B and Os--B codoped graphene systems can
establish long-range ferromagnetic order and open nontrivial band gaps because
of the spin-orbit coupling with the non-vanishing Berry curvatures to host the
QAHE. 3) The calculated Rashba splitting energy in Re--B and Pt--B codoped
graphene systems can reach up to 158 and 85~meV, respectively, which is several
orders of magnitude higher than the reported intrinsic spin-orbit coupling
strength.
