No, At this time I am not receiving any warning.
Printable View
If you opened the painter on a wrong object you should have received a warning. Take my code and change "viewport()" to "this", run the application and look at the console.
Yes, You are saying true in this regard; but I am telling about the below mentioned code.
Code:
{ painter.setPen(Qt::blue); painter.drawLine(rect().topLeft(),rect().bottomRight()); }
You said you "forgot to call viewport()". I understood that you didn't open a painter on it.