hyperspyui.smartcolorsvgiconengine module

Created on Wed Jul 29 18:09:56 2015

@author: vidarton

class hyperspyui.smartcolorsvgiconengine.SmartColorSVGIconEngine(use_qt_disabled=False, other=None)

Bases: PyQt5.QtGui.QIconEngine

This class is basically a port to Python from the code for Qt’s QSvgIconEnginePlugin. On top of this has been added the ability to exchange colors in the icons. It’s also possible in the future to do more advanced XML pro-processing. Note: Some of the more esoteric uses of QIcon might not be fully tested for yet.

_loadDataForModeAndState(renderer, mode, state)

Load SVG data to renderer.

_make_cache_key(size, mode, state)

Make a unique, reproducable key to store/lookup icons in the pixmap cache.

_replace_in_stream(filename, color_key='default')

Opens supplied SVG file, parses the file replacing colors according to the dictionary color_replacements. Returns a QByteArray of the processed content.

_set_replacements_from_palette()

Sets _automatic_color_replacements attribute from application palette. Updates _palette_key to the cacheKey of the used palette.

actualSize(self, QSize, QIcon.Mode, QIcon.State) QSize
addFile(self, str, QSize, QIcon.Mode, QIcon.State)
addPixmap(self, QPixmap, QIcon.Mode, QIcon.State)
clone(self) QIconEngine
key(self) str
paint(self, QPainter, QRect, QIcon.Mode, QIcon.State)
pixmap(self, QSize, QIcon.Mode, QIcon.State) QPixmap
read(self, QDataStream) bool
serial_gen = 0
write(self, QDataStream) bool