Results 1 to 4 of 4

Thread: StyleSheets: border-image performance

  1. #1
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default StyleSheets: border-image performance

    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.
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

  2. #2
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: StyleSheets: border-image performance

    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;
    }

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: StyleSheets: border-image performance

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Apr 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: StyleSheets: border-image performance

    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.

Similar Threads

  1. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.