PDA

View Full Version : StyleSheets: border-image performance



GuS
19th May 2008, 20:09
Hi all!!

This post is more an advice more than other thing.
I use a lot stylesheets implementation on my app. and so far there is not performance problems (and even when i use lot of pixmaps backgrounds).
For backrgrounds that needs to be scaled i use boder-image, for example, i use it only on pushButtons, comboBox, lineEdits, etc. Those are small images in fact, but when i try to use border-image on big widgets (lets say, a GroupBox) the performance start to decrease on the app. So, things start to interact more slow (like hover effect).

Is there any advice to improve this when i use border-image on bigger backgrounds?

By the way, i always use this method for border image, example of groupBox:



QGroupBox {
border-image: url(:/Styles/styles/groupBoxBg.png) 4 4 4 4 stretch stretch;
border-width: 4px 4px 4px 4px;}


Thanks in advance

Cheers.

qt_surface
11th February 2011, 16:17
I have the same issue drawing a background in a QFrame using border-image. For some reason cpu usage goes up to 40%. The original image is 1600x1400 and I need to scale down to 1024x768. Is there any other way to scale background images without killing performace?


#loginFrame {
background-color: #005072;
border-image: url(/usr/local/share/nxtop/Images/backgrounds/lockscreen.png) 4 4 4 4 stretch stretch;
}

wysota
11th February 2011, 18:07
If you want to scale a large image then it just has to take time. If you want, you can pre-scale it yourself and use a smaller picture. Or don't use border-image.

Zifix
15th May 2013, 12:42
For people, who find this page from search engines: you can use tiny images, like 30*30, and "repeat" option, I guess it increase the performance.