[Qt-interest] QGraphicsView coordinates
Rohan McGovern
rmcgover at trolltech.com
Wed Dec 17 07:13:11 CET 2008
On Wednesday 17 December 2008, Phil wrote:
>
> What you say is absolutely true but how do I now specifically
> request that the painting takes place on the frame and not on
> main window? QPainter (frame_name) compiles but nothing is
> painted and QPainter (this) paints on the main window.
>
> I know the following is a clue but but how do I force a painting
> event?
>
> "QPainter::begin: Widget painting can only begin as a result of a
> paintEvent"
>
> This is my paintEvent code:
>
> void Pest::paintEvent(QPaintEvent *)
> {
> QPainter paint(mapFrame);
>
> paintMap(&paint); //this function draws the pixmap, draws a
> few points and draws text on the map.
> }
>
If you want to paint on mapFrame, which is a widget, do it from
within mapFrame's paintEvent function.
--
Rohan McGovern
Qt Software, Nokia
More information about the Qt-interest-old
mailing list