KolourPaint places widgets on top of a KToolBar for its "Colour Box" (a great abuse of KToolBar, I know - I'll be looking at fixing this). Unfortunately, in Qt4, right clicking on a colour patch (e.g. the transparent or green, circled in red below):
no longer selects the background colour - it brings up the toolbar popup menu instead:
(neat "Lock Toolbars" option BTW)
It turns out that implementing QWidget::mousePressEvent() no longer stops your parent from receiving the right mouse press that would invoke contextMenuEvent(). Spotting the new contextMenuPolicy, I figured that I would just set my children widgets to Qt::NoContextMenu ("the widget does not feature a context menu"). Doesn't work.
They way I got around it was to get the children to eat/accept() the contextMenuEvent(). Another undocumented, subtle change between Qt3 and 4...
In the meantime, I have started porting KolourPaint4 to a new "kpPainter" that abstracts away QPainter (not committed to SVN yet). Rectangles now work and are no longer 1 pixel higher and wider than they should be. Eventually, this abstraction will allow me to dump the Qt graphics routines for a better graphics library.