Hi David,
There's also a docked dock widget.
When I first load an image and click on it the mousePressEvent of the top window is driven which in turn calls update() to drive paintEvent(). I have qDebug() code in the paintEvent code so I know the rectangles I want are being drawn.
Just to be sure:
From the window handle, it looks as if "Registering and Stacking" on the left is the dock widget.
The widget on the right is where the rectangles are being drawn, but not shown (I'll call it Sky-Widget)
When you undock the dock widget or resize the main window, the rectangles suddenly show up on the Sky-Widget.
stuff drawn in paintEvent is not visible
I have a widget (SelectRect) that (I am fairly sure) is on top of another widget that displays an image
I can't download anything from dropbox, so I don't know the code of SelectRect. But from the name, I would guess that a new SelectRect is instantiated each time the user draws a rectangle.
So here's a a poke in the dark:
The initial Z-order of Sky-Widget and SelectRect doesn't reflect what should be shown. The rectangles are in the background or even hidden (qDebug() << __FUNCTION__ << isVisible();at the end of paintEventwill tell).
There is a code path somewhere in the application source, that sets the Z-order right. That code path is not entered after the rectangles have been drawn.
The Z-order code path is, however, entered when the main window consumes an updateEvent: That's the case when it's being resized or the dock widget is undocked.
Once the Z-order is correct, there are no more problems (Z-orders do not change automagically...).
=> somewhere in the code QWidget::show()or QWidget::raise() is probably called on SelectRect.
Throwing a few qDebugs into the neighborhood may bring some more insight.
Cheers
Axel