[Panel-devel] Patch to cache standard applet background background

Thomas Georgiou tageorgiou at gmail.com
Sun Jul 29 23:58:28 CEST 2007


On Sunday 29 July 2007 03:31:38 pm Zack Rusin wrote:
> +        if (cachedBackground || cachedBackground->size() !=
> QSize(leftWidth + contentWidth + rightWidth, topHeight + contentHeight +
> bottomHeight)) {
> I don't think this part works.
> if (pointerIsValid || invalidPointer->size() != QSize(...))
> I guess cachedBackground is always valid.
> +            if (!cachedBackground) {
> +                delete cachedBackground;
> +            }
>
> the "if" part is redundant. delete cachedBackground by itself is ok.
This was the only way i could get it to work.  Feel free to try and fix it and 
explain to me why.

> +        p2->drawPixmap(leftOffset, topOffset, *cachedBackground);
> this part works by accident (if at all :) ).
Ah, thanks, I'll end the painter next time. Feel free to do it if you want. 
Out of curiosity, what would happen if the painter was a pointer and deleted 
before it was ended?

Thomas Georgiou


More information about the Panel-devel mailing list