PDA

View Full Version : QWorspace background, causes slow-down!



grellsworth
1st December 2007, 14:55
I'm using a QWorkspace in an MDI application, and I'm loading a picture into the background using:


QPixmap backgroundImage("/picture.png");
QBrush backgroundBrush(backgroundImage);

QWorkspace *mainWorkspace = new QWorkspace;

mainWorkspace->setBackground(backgroundBrush);

I've noticed that when I add child window to the Workspace (using addWindow), the application acts extremely slow. It seems to be due to the background image.

Moving a child window within the QWorkspace causes the background image to redraw, and this causes the movment of the child window to be "jerky", and sometimes the child window doesn't want to move at all.

So my question is this... is there any way to optimize my application so that it's not so slowed down? I think it's the background image that's causing it, but I've reduced the image to 160x120, and the application is still very slow.

Any help would be GREATLY appreciated.

wysota
1st December 2007, 15:13
Could you provide a minimum compilable example reproducing the problem?