How do I create a widget and add it to the viewport in c++?

the answer without having to watch videos

this post also contains lots of useful info (a bit old but still useful)