Drawing a QRectangle in the Red, Green, or Yellow Slice View Windows

In my custom module, the user can adjust the size and position of the image capture of the RGY slice view windows. I would like to implement a button that will show the area to be captured by accessing the QPainter of the slice view window and then drawing a red rectangle in that window.

Here is an example of the script I have been trying to use:
layoutManager = slicer.app.layoutManager()
greenView = layoutManager.sliceWidget(‘Green’).sliceView()
michelangelo = qt.QPainter(greenView)

Nothing shows up after running the code.

I would recommend to draw a rectangle in a slice view using a markup ROI or plane instead.