Nominate our 2022 Qt Champions!

DrawBackground preserving items drawn on foreground

  • Hey i m developing an application in which i have a class "abcd" inheriting QGraphicScene.I m overriding drawForeGround to display vector image and drawBackground to display raster image..
    I m able to draw on foreground keeping background image(i.e vector over raster works fine) but after drawing some foreground items(vector layers) if i try to drawbackground items drawn on foreground are not visible.
    I know drawBackground method should be used before drawing on background or item layer but i need this kind of functionality for my app.Background should be drawn but items already drawn on foreground should remail visible.
    Please suggest me some way to achieve this!

  • Sorry, it just doesn't work this way. First the background is drawn, then the foreground is drawn over it.

Log in to reply