How to create a viewport in a widget

Would a render target be enough?

Image from Gyazo