How to set a QPalette::Window to a QGraphicsScene?
Unsolved
General and Desktop
-
Hi guys,
I'm trying to set this color rule QPalette::Window to be a background in a QGraphicsScene,
but so far I dont be able to do it.
I tried some the code bellow:QPalette p(palette()); p.setBrush(Qt::Window); setPalette(p); /* --*/ setPalette(QPalette(QPalette::Window)); /*---*/ QPalette p(palette()); p.setColor(QPalette::Window,Qt::gray); scene()->setPalette(p);
How i do this?
-
@Lays147
i think setting it on the QGraphicsView would be more correct.
Alternatively you can subclass QGraphicsView and reimplement QGraphicsView::drawBackground()