Test case attached really explains everything
If you try to resize window or let it loose focus you will see that border of QPlainTextEdit is erased just below the scroll bar. Screenshot included.
Here is forum thread about this issue:
This little code can be quickly used to see the effect. Just run this code and then change the focus to other window using Alt+tab (see screenshot)