"""
PySide stub files generated by **IceSpringPySideStubs**

Home: https://baijifeilong.github.io/2022/01/06/ice-spring-pyside-stubs/index.html

Github: https://github.com/baijifeilong/IceSpringPySideStubs

PyPI(PySide2): https://pypi.org/project/IceSpringPySideStubs-PySide2

PyPI(PySide6): https://pypi.org/project/IceSpringPySideStubs-PySide6

PyPI(PyQt5): https://pypi.org/project/IceSpringPySideStubs-PyQt5

PyPI(PyQt6): https://pypi.org/project/IceSpringPySideStubs-PyQt6

Generated by BaiJiFeiLong@gmail.com

License: MIT
"""
import typing
from PyQt6 import QtGui
from PyQt6 import QtCore
from PyQt6.QtWidgets import *


class QWidgetAction(QtGui.QAction):
    """
    https://doc.qt.io/qt-6/qwidgetaction.html

    **Detailed Description**

    Most actions in an application are represented as items in menus or buttons
    in toolbars. However sometimes more complex widgets are necessary. For
    example a zoom action in a word processor may be realized using a
    **QComboBox**  in a **QToolBar** , presenting a range of different zoom
    levels. **QToolBar**  provides **QToolBar::insertWidget** () as convenience
    function for inserting a single widget. However if you want to implement an
    action that uses custom widgets for visualization in multiple containers
    then you have to subclass QWidgetAction.

    If a QWidgetAction is added for example to a **QToolBar**  then
    **QWidgetAction::createWidget** () is called. Reimplementations of that
    function should create a new custom widget with the specified parent.

    If the action is removed from a container widget then
    **QWidgetAction::deleteWidget** () is called with the previously created
    custom widget as argument. The default implementation hides the widget and
    deletes it using **QObject::deleteLater** ().

    If you have only one single custom widget then you can set it as default
    widget using **setDefaultWidget** (). That widget will then be used if the
    action is added to a **QToolBar** , or in general to an action container
    that supports QWidgetAction. If a QWidgetAction with only a default widget
    is added to two toolbars at the same time then the default widget is shown
    only in the first toolbar the action was added to. QWidgetAction takes over
    ownership of the default widget.

    Note that it is up to the widget to activate the action, for example by
    reimplementing mouse event handlers and calling **QAction::trigger** ().

    **macOS** : If you add a widget to a menu in the application's menu bar on
    macOS, the widget will be added and it will function but with some
    limitations:

    1. The widget is reparented away from the **QMenu**  to the native menu
    view. If you show the menu in some other place (e.g. as a popup menu), the
    widget will not be there.
      2. Focus/Keyboard handling of the widget is not
    possible.
      3. Due to Apple's design, mouse tracking on the widget currently
    does not work.
      4. Connecting the **triggered** () signal to a slot that
    opens a modal dialog will cause a crash in macOS 10.4 (known bug
    acknowledged by Apple), a workaround is to use a QueuedConnection instead of
    a DirectConnection.

    **See also** **QAction** , **QActionGroup** , and **QWidget** .
    """

    def __init__(self, parent: QtCore.QObject) -> None:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#QWidgetAction

        **QWidgetAction::QWidgetAction(QObject * parent )**

        Constructs an action with **parent**.
        """
        ...

    def createdWidgets(self) -> typing.List[QWidget]:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#createdWidgets

        **[protected] QList<QWidget *> QWidgetAction::createdWidgets() const**

        Returns the list of widgets that have been using **createWidget** () and
        are currently in use by widgets the action has been added to.
        """
        ...

    def deleteWidget(self, widget: QWidget) -> None:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#deleteWidget

        **[virtual protected] void QWidgetAction::deleteWidget(QWidget * widget
        )**

        This function is called whenever the action is removed from a container
        widget that displays the action using a custom **widget** previously
        created using **createWidget** (). The default implementation hides the
        **widget** and schedules it for deletion using **QObject::deleteLater**
        ().

        **See also** **createWidget** ().
        """
        ...

    def createWidget(self, parent: QWidget) -> QWidget:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#createWidget

        **[virtual protected] QWidget *QWidgetAction::createWidget(QWidget *
        parent )**

        This function is called whenever the action is added to a container
        widget that supports custom widgets. If you don't want a custom widget
        to be used as representation of the action in the specified **parent**
        widget then 0 should be returned.

        **See also** **deleteWidget** ().
        """
        ...

    def eventFilter(self, a0: QtCore.QObject, a1: QtCore.QEvent) -> bool:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#eventFilter

        **[override virtual protected] bool QWidgetAction::eventFilter(QObject *
        obj , QEvent * event )**

        Reimplements: **QObject::eventFilter** (QObject *watched, QEvent
        *event).
        """
        ...

    def event(self, a0: QtCore.QEvent) -> bool:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#event

        **[override virtual protected] bool QWidgetAction::event(QEvent * event
        )**

        Reimplements: **QAction::event** (QEvent *e).
        """
        ...

    def releaseWidget(self, widget: QWidget) -> None:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#releaseWidget

        **void QWidgetAction::releaseWidget(QWidget * widget )**

        Releases the specified **widget**.

        Container widgets that support actions call this function when a widget
        action is removed.

        **See also** **requestWidget** (), **deleteWidget** (), and
        **defaultWidget** ().
        """
        ...

    def requestWidget(self, parent: QWidget) -> QWidget:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#requestWidget

        **QWidget *QWidgetAction::requestWidget(QWidget * parent )**

        Returns a widget that represents the action, with the given **parent**.

        Container widgets that support actions can call this function to request
        a widget as visual representation of the action.

        **See also** **releaseWidget** (), **createWidget** (), and
        **defaultWidget** ().
        """
        ...

    def defaultWidget(self) -> QWidget:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#defaultWidget

        **QWidget *QWidgetAction::defaultWidget() const**

        Returns the default widget.

        **See also** **setDefaultWidget** ().
        """
        ...

    def setDefaultWidget(self, w: QWidget) -> None:
        """
        https://doc.qt.io/qt-6/qwidgetaction.html#setDefaultWidget

        **void QWidgetAction::setDefaultWidget(QWidget * widget )**

        Sets **widget** to be the default widget. The ownership is transferred
        to **QWidgetAction** . Unless **createWidget** () is reimplemented by a
        subclass to return a new widget the default widget is used when a
        container widget requests a widget through **requestWidget** ().

        **See also** **defaultWidget** ().
        """
        ...
