drawBackground function.....
I'd like to know how this function operate:
void drawBackground(QPainter *painter, const QRectF &rect);
I Know that this function is called when a repaint event is being.
Now.....what kind of settings has the painter?
How can I set them? and the rect?
I also don't understand why the "scene->setBackgroundBrush()" doesn't work when the virtual function drawBackground() is reimplemented(in a scene or view subclass).....
I'd also like to have some examples.....
excuse me for my poor english, i hope that you can understand me!!! Thanks a lot.
Re: drawBackground function.....
How about taking a look at documentation of QPainter, QRectF and QGraphicsScene::drawBackground()?
Re: drawBackground function.....
I forget to tell you that i saw a lot of times the reference........
Re: drawBackground function.....
Do not look at it - read it :)
I can only repeat what is written there especially that I don't know what exactly you want to know. Read the docs and when you have specific questions, ask them.
As for the only specific (yet trivial) question I see:
Quote:
I also don't understand why the "scene->setBackgroundBrush()" doesn't work when the virtual function drawBackground() is reimplemented(in a scene or view subclass).....
Because the background brush is used by the default implementation of drawBackground(), so when you reimplement it without calling the base class explicitely, it won't be used.
Re: drawBackground function.....
;)
the bakgroundbrush works if a call the base class
...thx