MECO™ API Reference
Public Member Functions | Static Public Attributes | List of all members
mQtWidgets.iconLib.Icon Class Reference

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

Inheritance diagram for mQtWidgets.iconLib.Icon:

Public Member Functions

def __init__ (self, path=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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

def mQtWidgets.iconLib.Icon.__init__ (   self,
  path = None,
  colorScheme = ColorScheme.kDark 
)

Constructor.

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

Member Function Documentation

◆ builtInIconPath()

def mQtWidgets.iconLib.Icon.builtInIconPath (   self)

Built-in icon path.

Exceptions
N/A
Returns
str - Absolute path.

◆ packageIconPath()

def mQtWidgets.iconLib.Icon.packageIconPath (   self)

Package icon path.

Exceptions
N/A
Returns
str - Absolute path.

◆ getFile()

def mQtWidgets.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 mQtWidgets.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 mQtWidgets.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 mQtWidgets.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 mQtWidgets.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 mQtWidgets.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 mQtWidgets.iconLib.Platform enum class.
Exceptions
N/A
Returns
QIcon - QIcon instance.

◆ createPlatformPixmap()

def mQtWidgets.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 mQtWidgets.iconLib.Platform enum class.
Exceptions
N/A
Returns
QPixmap - QPixmap instance.

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