Nominate our 2022 Qt Champions!

[SOLVED] Symbian^3 and QGraphicsScene

  • Hi,

    I've a problem with QGraphicsScene, when used on Symbian^3.

    Maybe some of you already know that I'm developing homescreen widgets (I posted about that some weeks ago), and they're working fine.

    I just use a QPixmap with a fixed size, that I convert to a Symbian bitmap and I render it to a homescreen widget using SDK APIs.

    If I paint directly in my source QPixmap, everything works perfectly, transparency is ok.

    But if I have a QGraphicsScene, I put some QGraphicsWidgets inside, and then I render QGraphicsScene on the source QPixmap, transparency fails (sometimes is black, sometimes it grabs background from a bitmap that I don't know about).

    What surprises me a lot is that, if I render a rect that's outside QRect(0,0,312,82) (312x82 is the size of a homescreen widget), plus some offset due to the fact that homescreen widget is horizontally narrower than screen, transparency works again.

    It seems that QGraphicsScene, when created, inits its background to something that should not be, and there's no way to clear it. I tried a "clear", "setBackground(Qt::transparent)", "invalidate" ... nothing.

    Of course I can work outside such "dead zone", but after a while transparency gets broken even there.

    How can I force QGraphicsScene to restore its background anytime I use it?


  • Hi,

    found the issue. QGraphicsProxyWidget containing a QLabel needs QLabel to have a transparent background, before placing it in scene. So a setStyleSheet("background-color: transparent") fixed the problem.


Log in to reply