Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-14000

setStyleSheet API to set style for QSvgRenderer

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P5: Not important
    • None
    • 4.7.0
    • SVG Support
    • None

    Description

      There should be a capability of setting a stylesheet to the Qt Svg module. All Svg images loaded would by default inherit these styles. Svg already handles CSS, so why not provide an API to persist this?

      Couple of scenarios where I needed this:
      1. I'm writing a dialog to browse hundreds of SVG images and if they are using the same single external CSS (theme), the CSS gets parsed each time, when each SVG image is rendered. This is bringing the performance down drastically.

      I did some hack in the qsvghandler_p.h to cache this CSS, and thus greatly improving performance for my needs.
      But seriously a more elegant solution would be to set this at some root level. I feel this is a very common scenario.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            chetankjain chetankjain
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes