flyout ====== .. py:module:: qfluentwidgets.components.widgets.flyout Module Contents --------------- .. autoapisummary:: qfluentwidgets.components.widgets.flyout.FlyoutAnimationType qfluentwidgets.components.widgets.flyout.IconWidget qfluentwidgets.components.widgets.flyout.FlyoutViewBase qfluentwidgets.components.widgets.flyout.FlyoutView qfluentwidgets.components.widgets.flyout.Flyout qfluentwidgets.components.widgets.flyout.FlyoutAnimationManager qfluentwidgets.components.widgets.flyout.PullUpFlyoutAnimationManager qfluentwidgets.components.widgets.flyout.DropDownFlyoutAnimationManager qfluentwidgets.components.widgets.flyout.SlideLeftFlyoutAnimationManager qfluentwidgets.components.widgets.flyout.SlideRightFlyoutAnimationManager qfluentwidgets.components.widgets.flyout.FadeInFlyoutAnimationManager qfluentwidgets.components.widgets.flyout.DummyFlyoutAnimationManager .. py:class:: FlyoutAnimationType Bases: :py:obj:`enum.Enum` Flyout animation type .. py:attribute:: PULL_UP :value: 0 .. py:attribute:: DROP_DOWN :value: 1 .. py:attribute:: SLIDE_LEFT :value: 2 .. py:attribute:: SLIDE_RIGHT :value: 3 .. py:attribute:: FADE_IN :value: 4 .. py:attribute:: NONE :value: 5 .. py:class:: IconWidget(icon, parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` .. py:attribute:: icon .. py:method:: paintEvent(e) .. py:class:: FlyoutViewBase(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Flyout view base class .. py:method:: addWidget(widget: PyQt5.QtWidgets.QWidget, stretch=0, align=Qt.AlignLeft) :abstractmethod: .. py:method:: backgroundColor() .. py:method:: borderColor() .. py:method:: paintEvent(e) .. py:class:: FlyoutView(title: str, content: str, icon: Union[qfluentwidgets.common.icon.FluentIconBase, PyQt5.QtGui.QIcon, str] = None, image: Union[str, PyQt5.QtGui.QPixmap, PyQt5.QtGui.QImage] = None, isClosable=False, parent=None) Bases: :py:obj:`FlyoutViewBase` Flyout view .. py:attribute:: closed .. py:attribute:: icon :value: None .. py:attribute:: title .. py:attribute:: image :value: None .. py:attribute:: content .. py:attribute:: isClosable :value: False .. py:attribute:: vBoxLayout .. py:attribute:: viewLayout .. py:attribute:: widgetLayout .. py:attribute:: titleLabel .. py:attribute:: contentLabel .. py:attribute:: iconWidget .. py:attribute:: imageLabel .. py:attribute:: closeButton .. py:method:: addWidget(widget: PyQt5.QtWidgets.QWidget, stretch=0, align=Qt.AlignLeft) add widget to view .. py:method:: showEvent(e) .. py:class:: Flyout(view: FlyoutViewBase, parent=None, isDeleteOnClose=True, isMacInputMethodEnabled=False) Bases: :py:obj:`PyQt5.QtWidgets.QWidget` Flyout .. py:attribute:: closed .. py:attribute:: view .. py:attribute:: hBoxLayout .. py:attribute:: aniManager :type: FlyoutAnimationManager :value: None .. py:attribute:: isDeleteOnClose :value: True .. py:attribute:: isMacInputMethodEnabled :value: False .. py:method:: eventFilter(watched, event) .. py:method:: setShadowEffect(blurRadius=35, offset=(0, 8)) add shadow to dialog .. py:method:: closeEvent(e) .. py:method:: showEvent(e) .. py:method:: exec(pos: PyQt5.QtCore.QPoint, aniType=FlyoutAnimationType.PULL_UP) show calendar view .. py:method:: make(view: FlyoutViewBase, target: Union[PyQt5.QtWidgets.QWidget, PyQt5.QtCore.QPoint] = None, parent=None, aniType=FlyoutAnimationType.PULL_UP, isDeleteOnClose=True, isMacInputMethodEnabled=False) :classmethod: create and show a flyout Parameters ---------- view: FlyoutViewBase flyout view target: QWidget | QPoint the target widget or position to show flyout parent: QWidget parent window aniType: FlyoutAnimationType flyout animation type isDeleteOnClose: bool whether delete flyout automatically when flyout is closed .. py:method:: create(title: str, content: str, icon: Union[qfluentwidgets.common.icon.FluentIconBase, PyQt5.QtGui.QIcon, str] = None, image: Union[str, PyQt5.QtGui.QPixmap, PyQt5.QtGui.QImage] = None, isClosable=False, target: Union[PyQt5.QtWidgets.QWidget, PyQt5.QtCore.QPoint] = None, parent=None, aniType=FlyoutAnimationType.PULL_UP, isDeleteOnClose=True, isMacInputMethodEnabled=False) :classmethod: create and show a flyout using the default view Parameters ---------- title: str the title of teaching tip content: str the content of teaching tip icon: InfoBarIcon | FluentIconBase | QIcon | str the icon of teaching tip image: str | QPixmap | QImage the image of teaching tip isClosable: bool whether to show the close button target: QWidget | QPoint the target widget or position to show flyout parent: QWidget parent window aniType: FlyoutAnimationType flyout animation type isDeleteOnClose: bool whether delete flyout automatically when flyout is closed .. py:method:: fadeOut() .. py:class:: FlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`PyQt5.QtCore.QObject` Flyout animation manager .. py:attribute:: managers .. py:attribute:: flyout .. py:attribute:: aniGroup .. py:attribute:: slideAni .. py:attribute:: opacityAni .. py:method:: register(name) :classmethod: register menu animation manager Parameters ---------- name: Any the name of manager, it should be unique .. py:method:: exec(pos: PyQt5.QtCore.QPoint) :abstractmethod: start animation .. py:method:: position(target: PyQt5.QtWidgets.QWidget) :abstractmethod: return the top left position relative to the target .. py:method:: make(aniType: FlyoutAnimationType, flyout: Flyout) -> FlyoutAnimationManager :classmethod: mask animation manager .. py:class:: PullUpFlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`FlyoutAnimationManager` Pull up flyout animation manager .. py:method:: position(target: PyQt5.QtWidgets.QWidget) return the top left position relative to the target .. py:method:: exec(pos: PyQt5.QtCore.QPoint) start animation .. py:class:: DropDownFlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`FlyoutAnimationManager` Drop down flyout animation manager .. py:method:: position(target: PyQt5.QtWidgets.QWidget) return the top left position relative to the target .. py:method:: exec(pos: PyQt5.QtCore.QPoint) start animation .. py:class:: SlideLeftFlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`FlyoutAnimationManager` Slide left flyout animation manager .. py:method:: position(target: PyQt5.QtWidgets.QWidget) return the top left position relative to the target .. py:method:: exec(pos: PyQt5.QtCore.QPoint) start animation .. py:class:: SlideRightFlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`FlyoutAnimationManager` Slide right flyout animation manager .. py:method:: position(target: PyQt5.QtWidgets.QWidget) return the top left position relative to the target .. py:method:: exec(pos: PyQt5.QtCore.QPoint) start animation .. py:class:: FadeInFlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`FlyoutAnimationManager` Fade in flyout animation manager .. py:method:: position(target: PyQt5.QtWidgets.QWidget) return the top left position relative to the target .. py:method:: exec(pos: PyQt5.QtCore.QPoint) start animation .. py:class:: DummyFlyoutAnimationManager(flyout: Flyout) Bases: :py:obj:`FlyoutAnimationManager` Dummy flyout animation manager .. py:method:: exec(pos: PyQt5.QtCore.QPoint) start animation .. py:method:: position(target: PyQt5.QtWidgets.QWidget) return the top left position relative to the target