info_badge

Module Contents

InfoLevel

Info level

InfoBadgePosition

Info badge position

InfoBadge

Information badge

DotInfoBadge

Dot info badge

IconInfoBadge

Icon icon badge

InfoBadgeManager

Info badge manager

TopRightInfoBadgeManager

Top right info badge manager

RightInfoBadgeManager

Right info badge manager

BottomRightInfoBadgeManager

Bottom right info badge manager

TopLeftInfoBadgeManager

Top left info badge manager

LeftInfoBadgeManager

Top left info badge manager

BottomLeftInfoBadgeManager

Bottom left info badge manager

class InfoLevel

Bases: enum.Enum

Info level

INFOAMTION = 'Info'
SUCCESS = 'Success'
ATTENTION = 'Attension'
WARNING = 'Warning'
ERROR = 'Error'
class InfoBadgePosition

Bases: enum.Enum

Info badge position

TOP_RIGHT = 0
BOTTOM_RIGHT = 1
RIGHT = 2
TOP_LEFT = 3
BOTTOM_LEFT = 4
LEFT = 5
NAVIGATION_ITEM = 6
class InfoBadge(parent: PyQt5.QtWidgets.QWidget = None, level=InfoLevel.ATTENTION)

Bases: PyQt5.QtWidgets.QLabel

Information badge

Constructors

  • InfoBadge(parent: QWidget = None, `level`=InfoLevel.ATTENTION)

  • InfoBadge(text: str, parent: QWidget = None, `level`=InfoLevel.ATTENTION)

  • InfoBadge(num: int, parent: QWidget = None, `level`=InfoLevel.ATTENTION)

  • InfoBadge(num: float, parent: QWidget = None, `level`=InfoLevel.ATTENTION)

setLevel(level: InfoLevel)

set infomation level

setProperty(name: str, value)
setCustomBackgroundColor(light, dark)

set the custom background color

Parameters

light, dark: str | Qt.GlobalColor | QColor

background color in light/dark theme mode

paintEvent(e)
classmethod make(text: str | float, parent=None, level=InfoLevel.INFOAMTION, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod info(text: str | float, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod success(text: str | float, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod attension(text: str | float, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod warning(text: str | float, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod error(text: str | float, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod custom(text: str | float, light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)

create a badge with custom background color

Parameters

text: str | float

the text of badge

light, dark: str | Qt.GlobalColor | QColor

background color in light/dark theme mode

parent: QWidget

parent widget

target: QWidget

target widget to show the badge

pos: InfoBadgePosition

the position relative to target

class DotInfoBadge(parent=None, level=InfoLevel.ATTENTION)

Bases: InfoBadge

Dot info badge

paintEvent(e)
classmethod make(parent=None, level=InfoLevel.INFOAMTION, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod info(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod success(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod attension(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod warning(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod error(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod custom(light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)

create a badge with custom background color

Parameters

light, dark: str | Qt.GlobalColor | QColor

background color in light/dark theme mode

parent: QWidget

parent widget

class IconInfoBadge(parent: PyQt5.QtWidgets.QWidget = None, level=InfoLevel.ATTENTION)

Bases: InfoBadge

Icon icon badge

Constructors

  • IconInfoBadge(parent: QWidget = None, `level`=InfoLevel.ATTENTION)

  • IconInfoBadge(icon: QIcon | str | FluentIconBase, parent: QWidget = None, `level`=InfoLevel.ATTENTION)

setIcon(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase | str)

set the icon of info badge

icon()
iconSize()
setIconSize(size: PyQt5.QtCore.QSize)
paintEvent(e)
classmethod make(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None, level=InfoLevel.INFOAMTION, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod info(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod success(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod attension(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod warning(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod error(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)
classmethod custom(icon: PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT)

create a badge with custom background color

Parameters

icon: QIcon | FluentIconBase

the icon of badge

light, dark: str | Qt.GlobalColor | QColor

background color in light/dark theme mode

parent: QWidget

parent widget

class InfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: PyQt5.QtCore.QObject

Info badge manager

managers
eventFilter(obj, e: PyQt5.QtCore.QEvent)
classmethod register(name)

register menu animation manager

Parameters

name: Any

the name of manager, it should be unique

classmethod make(position: InfoBadgePosition, target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

mask info badge manager

position()

return the position of info badge

class TopRightInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: InfoBadgeManager

Top right info badge manager

position()

return the position of info badge

class RightInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: InfoBadgeManager

Right info badge manager

position()

return the position of info badge

class BottomRightInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: InfoBadgeManager

Bottom right info badge manager

position()

return the position of info badge

class TopLeftInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: InfoBadgeManager

Top left info badge manager

position()

return the position of info badge

class LeftInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: InfoBadgeManager

Top left info badge manager

position()

return the position of info badge

class BottomLeftInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge)

Bases: InfoBadgeManager

Bottom left info badge manager

position()

return the position of info badge