예제 #1
0
def icon(icon_path, color=None):
    """
    Returns Qt icon instance

    :param icon_path: Path were icon resource is located
    :param color:
    :return: New instance of a Qt icon
    :rtype: QtGui.QIcon
    """

    icon_pixmap = pixmap(icon_path, color=color)
    new_icon = QtGui.QIcon(icon_pixmap)

    return new_icon
예제 #2
0
def icon(name, extension='png', color=None):
    """
    Returns Artella icon
    :param name:
    :param extension:
    :param color:
    :return: QIcon
    """

    new_icon = get(ResourceTypes.ICON,
                   name=name,
                   extension=extension,
                   color=color)
    if not new_icon:
        return None if not qtutils.QT_AVAILABLE else QtGui.QIcon()

    return new_icon