I did try resetCachedContent(), but it did nothing really. Besides, caching is turned off by default according to Assistant.
I did try resetCachedContent(), but it did nothing really. Besides, caching is turned off by default according to Assistant.
My GV is created in a UI file and then as part of my program's init i set a brackground. This is the code I use:
Qt Code:
scene->setSceneRect(0, 0, fieldWidth, fieldHeight); fieldGV->setScene(scene);To copy to clipboard, switch view to plain text mode
Hope it helps.
mAx
do the image width and height and Scene rect width/height match ??
might be thers some scaling problem ???
Okay, but why can't you use setBackGroundBrush() again? I can call that from anywhere in my app and the background changes just fine. I guess it depends on exactly what you are trying to draw as the background.
mAx
workaround.
just add one item to scene and remove, this will redraw the background.
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
Or define the scene rect, no workaround needed. ;-)
Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
Nokia Software Manager, Qt Development
is it a partial background refresh where it just refreshes the scene and leaves everything outside the scene the old background color or does it just plain not work?
You might also try updating to 4.2.3 since it looks like they did something on this...
"General improvements
--------------------
- Graphics View
* Calling QGraphicsScene::update() without arguments now correctly
updates the entire scene.
* Changing the background brush in QGraphicsScene now correctly updates
the entire scene
"
Last edited by giverson; 9th March 2007 at 15:07.
Bookmarks