info_badge ========== .. py:module:: qfluentwidgets.components.widgets.info_badge Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.widgets.info_badge.InfoLevel qfluentwidgets.components.widgets.info_badge.InfoBadgePosition qfluentwidgets.components.widgets.info_badge.InfoBadge qfluentwidgets.components.widgets.info_badge.DotInfoBadge qfluentwidgets.components.widgets.info_badge.IconInfoBadge qfluentwidgets.components.widgets.info_badge.InfoBadgeManager qfluentwidgets.components.widgets.info_badge.TopRightInfoBadgeManager qfluentwidgets.components.widgets.info_badge.RightInfoBadgeManager qfluentwidgets.components.widgets.info_badge.BottomRightInfoBadgeManager qfluentwidgets.components.widgets.info_badge.TopLeftInfoBadgeManager qfluentwidgets.components.widgets.info_badge.LeftInfoBadgeManager qfluentwidgets.components.widgets.info_badge.BottomLeftInfoBadgeManager .. py:class:: InfoLevel Bases: :py:obj:`enum.Enum` Info level .. py:attribute:: INFOAMTION :value: 'Info' .. py:attribute:: SUCCESS :value: 'Success' .. py:attribute:: ATTENTION :value: 'Attension' .. py:attribute:: WARNING :value: 'Warning' .. py:attribute:: ERROR :value: 'Error' .. py:class:: InfoBadgePosition Bases: :py:obj:`enum.Enum` Info badge position .. py:attribute:: TOP_RIGHT :value: 0 .. py:attribute:: BOTTOM_RIGHT :value: 1 .. py:attribute:: RIGHT :value: 2 .. py:attribute:: TOP_LEFT :value: 3 .. py:attribute:: BOTTOM_LEFT :value: 4 .. py:attribute:: LEFT :value: 5 .. py:attribute:: NAVIGATION_ITEM :value: 6 .. py:class:: InfoBadge(parent: PyQt5.QtWidgets.QWidget = None, level=InfoLevel.ATTENTION) Bases: :py:obj:`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) .. py:attribute:: level .. py:attribute:: lightBackgroundColor :value: None .. py:attribute:: darkBackgroundColor :value: None .. py:attribute:: manager :type: InfoBadgeManager :value: None .. py:method:: setLevel(level: InfoLevel) set infomation level .. py:method:: setProperty(name: str, value) .. py:method:: setCustomBackgroundColor(light, dark) set the custom background color Parameters ---------- light, dark: str | Qt.GlobalColor | QColor background color in light/dark theme mode .. py:method:: paintEvent(e) .. py:method:: make(text: Union[str, float], parent=None, level=InfoLevel.INFOAMTION, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: info(text: Union[str, float], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: success(text: Union[str, float], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: attension(text: Union[str, float], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: warning(text: Union[str, float], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: error(text: Union[str, float], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: custom(text: Union[str, float], light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: 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 .. py:class:: DotInfoBadge(parent=None, level=InfoLevel.ATTENTION) Bases: :py:obj:`InfoBadge` Dot info badge .. py:method:: paintEvent(e) .. py:method:: make(parent=None, level=InfoLevel.INFOAMTION, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: info(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: success(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: attension(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: warning(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: error(parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: custom(light: PyQt5.QtGui.QColor, dark: PyQt5.QtGui.QColor, parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: 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 .. py:class:: IconInfoBadge(parent: PyQt5.QtWidgets.QWidget = None, level=InfoLevel.ATTENTION) Bases: :py:obj:`InfoBadge` Icon icon badge Constructors ------------ * IconInfoBadge(`parent`: QWidget = None, `level`=InfoLevel.ATTENTION) * IconInfoBadge(`icon`: QIcon | str | FluentIconBase, `parent`: QWidget = None, `level`=InfoLevel.ATTENTION) .. py:method:: setIcon(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase, str]) set the icon of info badge .. py:method:: icon() .. py:method:: iconSize() .. py:method:: setIconSize(size: PyQt5.QtCore.QSize) .. py:method:: paintEvent(e) .. py:method:: make(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None, level=InfoLevel.INFOAMTION, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: info(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: success(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: attension(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: warning(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: error(icon: Union[PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None, target: PyQt5.QtWidgets.QWidget = None, position=InfoBadgePosition.TOP_RIGHT) :classmethod: .. py:method:: custom(icon: Union[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) :classmethod: 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 .. py:class:: InfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`PyQt5.QtCore.QObject` Info badge manager .. py:attribute:: managers .. py:attribute:: target .. py:attribute:: badge .. py:method:: eventFilter(obj, e: PyQt5.QtCore.QEvent) .. py:method:: register(name) :classmethod: register menu animation manager Parameters ---------- name: Any the name of manager, it should be unique .. py:method:: make(position: InfoBadgePosition, target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) :classmethod: mask info badge manager .. py:method:: position() return the position of info badge .. py:class:: TopRightInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`InfoBadgeManager` Top right info badge manager .. py:method:: position() return the position of info badge .. py:class:: RightInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`InfoBadgeManager` Right info badge manager .. py:method:: position() return the position of info badge .. py:class:: BottomRightInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`InfoBadgeManager` Bottom right info badge manager .. py:method:: position() return the position of info badge .. py:class:: TopLeftInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`InfoBadgeManager` Top left info badge manager .. py:method:: position() return the position of info badge .. py:class:: LeftInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`InfoBadgeManager` Top left info badge manager .. py:method:: position() return the position of info badge .. py:class:: BottomLeftInfoBadgeManager(target: PyQt5.QtWidgets.QWidget, badge: InfoBadge) Bases: :py:obj:`InfoBadgeManager` Bottom left info badge manager .. py:method:: position() return the position of info badge