Stash Software API  2.0.0
Public Member Functions | Static Public Attributes | List of all members
sQtWidgets.iconLib.Icon Class Reference

[ CLASS ] - Class offers functionalities to find and create icons. More...

Inheritance diagram for sQtWidgets.iconLib.Icon:

Public Member Functions

def __init__ (self, absolutePath=None, colorScheme=ColorScheme.kDark)
 Constructor. More...
 
def getFile (self, fileName, useNA=True)
 Get absolute path of the given icon file. More...
 
def createIcon (self, fileName, useNA=True)
 Create and return an QIcon instance for the given icon file. More...
 
def createPixmap (self, fileName, useNA=True)
 Create and return a QPixmap instance for the given icon file. More...
 
def createIconForFileExtension (self, fileName, useNA=True)
 Create QIcon instance for the given file's extension. More...
 
def createPixmapForFileExtension (self, fileName, useNA=True)
 Create QPixmap instance for the given file's extension. More...
 
def createPlatformIcon (self, platformIcon=None)
 Create and return an QIcon instance for the given platform. More...
 
def createPlatformPixmap (self, platformIcon=None)
 Create and return an QPixmap instance for the given platform. More...
 
Properties
def builtInIconPath (self)
 Built-in icon path. More...
 
def packageIconPath (self)
 Package icon path. More...
 

Static Public Attributes

string ICON_FILE_EXTENSION = 'png'
 [ str ] - Icon file extension. More...
 

Detailed Description

[ CLASS ] - Class offers functionalities to find and create icons.

Constructor & Destructor Documentation

◆ __init__()

def sQtWidgets.iconLib.Icon.__init__ (   self,
  absolutePath = None,
  colorScheme = ColorScheme.kDark 
)

Constructor.

Parameters
absolutePath[ str | None | in ] - Absolute path of the python module where this class is being used (i.e. file).
colorScheme[ enum | sQtWidgets.iconLib.Icon.ColorScheme.kDark | in ] - Color scheme from sQtWidgets.iconLib.Icon.ColorScheme enum class.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ builtInIconPath()

def sQtWidgets.iconLib.Icon.builtInIconPath (   self)

Built-in icon path.

Exceptions
N/A
Returns
str - Absolute path.

◆ packageIconPath()

def sQtWidgets.iconLib.Icon.packageIconPath (   self)

Package icon path.

Exceptions
N/A
Returns
str - Absolute path.

◆ getFile()

def sQtWidgets.iconLib.Icon.getFile (   self,
  fileName,
  useNA = True 
)

Get absolute path of the given icon file.

Method first checks whether given fileName is a file, then checks local package and then checks built-in icon location for in order to retrieve the icon.

Parameters
fileName[ str | None | in ] - Absolute path or name of the icon file.
useNA[ bool | True | in ] - Use "Not Applicable" icon if icon with fileName doesn't exist.
Exceptions
N/A
Returns
str - Absolute path of the icon file.
None - If icon file doesn't exist.

◆ createIcon()

def sQtWidgets.iconLib.Icon.createIcon (   self,
  fileName,
  useNA = True 
)

Create and return an QIcon instance for the given icon file.

Method first checks whether given fileName is a file, then checks local package and then checks built-in icon location in order to retrieve the icon.

Parameters
fileName[ str | None | in ] - Absolute path or name of the icon file.
useNA[ bool | True | in ] - Use "Not Applicable" icon if icon with fileName doesn't exist.
Exceptions
N/A
Returns
QIcon - QIcon instance.

◆ createPixmap()

def sQtWidgets.iconLib.Icon.createPixmap (   self,
  fileName,
  useNA = True 
)

Create and return a QPixmap instance for the given icon file.

Method first checks whether given fileName is a file, then checks local package and then checks built-in icon location in order to retrieve the icon.

Parameters
fileName[ str | None | in ] - Absolute path or name of the icon file.
useNA[ bool | True | in ] - Use "Not Applicable" icon if icon with fileName doesn't exist.
Exceptions
N/A
Returns
QPixmap - QPixmap instance.

◆ createIconForFileExtension()

def sQtWidgets.iconLib.Icon.createIconForFileExtension (   self,
  fileName,
  useNA = True 
)

Create QIcon instance for the given file's extension.

Method first checks whether given fileName is a file, then checks local package and then checks built-in icon location in order to retrieve the icon.

Parameters
fileName[ str | None | in ] - Absolute path or name of the icon file.
useNA[ bool | True | in ] - Use "Not Applicable" icon if icon with fileName doesn't exist.
Exceptions
N/A
Returns
QIcon - QIcon instance.

◆ createPixmapForFileExtension()

def sQtWidgets.iconLib.Icon.createPixmapForFileExtension (   self,
  fileName,
  useNA = True 
)

Create QPixmap instance for the given file's extension.

Method first checks whether given fileName is a file, then checks local package and then checks built-in icon location in order to retrieve the icon.

Parameters
fileName[ str | None | in ] - Absolute path or name of the icon file.
useNA[ bool | True | in ] - Use "Not Applicable" icon if icon with fileName doesn't exist.
Exceptions
N/A
Returns
None - None.

◆ createPlatformIcon()

def sQtWidgets.iconLib.Icon.createPlatformIcon (   self,
  platformIcon = None 
)

Create and return an QIcon instance for the given platform.

If platformIcon argument is not provided, current platform will be used.

Parameters
platformIcon[ enum | None | in ] - Platform icon from sQtWidgets.iconLib.Platform enum class.
Exceptions
N/A
Returns
QIcon - QIcon instance.

◆ createPlatformPixmap()

def sQtWidgets.iconLib.Icon.createPlatformPixmap (   self,
  platformIcon = None 
)

Create and return an QPixmap instance for the given platform.

If platformIcon argument is not provided, current platform will be used.

Parameters
platformIcon[ enum | None | in ] - Platform icon from sQtWidgets.iconLib.Platform enum class.
Exceptions
N/A
Returns
QPixmap - QPixmap instance.

Member Data Documentation

◆ ICON_FILE_EXTENSION

string sQtWidgets.iconLib.Icon.ICON_FILE_EXTENSION = 'png'
static

[ str ] - Icon file extension.


The documentation for this class was generated from the following file: