aqt
===

.. py:module:: aqt


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/aqt/about/index
   /autoapi/aqt/addcards/index
   /autoapi/aqt/addons/index
   /autoapi/aqt/ankihub/index
   /autoapi/aqt/browser/index
   /autoapi/aqt/changenotetype/index
   /autoapi/aqt/clayout/index
   /autoapi/aqt/colors/index
   /autoapi/aqt/customstudy/index
   /autoapi/aqt/dbcheck/index
   /autoapi/aqt/debug_console/index
   /autoapi/aqt/deckbrowser/index
   /autoapi/aqt/deckchooser/index
   /autoapi/aqt/deckconf/index
   /autoapi/aqt/deckdescription/index
   /autoapi/aqt/deckoptions/index
   /autoapi/aqt/editcurrent/index
   /autoapi/aqt/editor/index
   /autoapi/aqt/emptycards/index
   /autoapi/aqt/errors/index
   /autoapi/aqt/exporting/index
   /autoapi/aqt/fields/index
   /autoapi/aqt/filtered_deck/index
   /autoapi/aqt/flags/index
   /autoapi/aqt/forms/index
   /autoapi/aqt/gui_hooks/index
   /autoapi/aqt/import_export/index
   /autoapi/aqt/importing/index
   /autoapi/aqt/legacy/index
   /autoapi/aqt/log/index
   /autoapi/aqt/main/index
   /autoapi/aqt/mediacheck/index
   /autoapi/aqt/mediasrv/index
   /autoapi/aqt/mediasync/index
   /autoapi/aqt/modelchooser/index
   /autoapi/aqt/models/index
   /autoapi/aqt/mpv/index
   /autoapi/aqt/notetypechooser/index
   /autoapi/aqt/operations/index
   /autoapi/aqt/overview/index
   /autoapi/aqt/package/index
   /autoapi/aqt/preferences/index
   /autoapi/aqt/profiles/index
   /autoapi/aqt/progress/index
   /autoapi/aqt/props/index
   /autoapi/aqt/qt/index
   /autoapi/aqt/reviewer/index
   /autoapi/aqt/schema_change_tracker/index
   /autoapi/aqt/sound/index
   /autoapi/aqt/stats/index
   /autoapi/aqt/studydeck/index
   /autoapi/aqt/stylesheets/index
   /autoapi/aqt/switch/index
   /autoapi/aqt/sync/index
   /autoapi/aqt/tagedit/index
   /autoapi/aqt/taglimit/index
   /autoapi/aqt/taskman/index
   /autoapi/aqt/theme/index
   /autoapi/aqt/toolbar/index
   /autoapi/aqt/tts/index
   /autoapi/aqt/undo/index
   /autoapi/aqt/update/index
   /autoapi/aqt/url_schemes/index
   /autoapi/aqt/utils/index
   /autoapi/aqt/webview/index
   /autoapi/aqt/widgetgallery/index
   /autoapi/aqt/winpaths/index


Attributes
----------

.. autoapisummary::

   aqt.appVersion
   aqt.appWebsite
   aqt.appWebsiteDownloadSection
   aqt.appDonate
   aqt.appShared
   aqt.appUpdate
   aqt.appHelpSite
   aqt.profiler
   aqt.mw
   aqt.dialogs
   aqt.PROFILE_CODE


Classes
-------

.. autoapisummary::

   aqt.DialogManager
   aqt.NativeEventFilter
   aqt.AnkiApp


Functions
---------

.. autoapisummary::

   aqt.setupLangAndBackend
   aqt.parseArgs
   aqt.setupGL
   aqt.write_profile_results
   aqt.run


Package Contents
----------------

.. py:data:: appVersion

.. py:data:: appWebsite
   :value: 'https://apps.ankiweb.net/'


.. py:data:: appWebsiteDownloadSection
   :value: 'https://apps.ankiweb.net/#download'


.. py:data:: appDonate
   :value: 'https://docs.ankiweb.net/contrib.html'


.. py:data:: appShared
   :value: 'https://ankiweb.net/shared/'


.. py:data:: appUpdate
   :value: 'https://ankiweb.net/update/desktop'


.. py:data:: appHelpSite
   :value: 'https://docs.ankiweb.net/'


.. py:data:: profiler
   :type:  cProfile.Profile | None
   :value: None


.. py:data:: mw
   :type:  main.AnkiQt
   :value: None


.. py:class:: DialogManager

   .. py:method:: open(name: str, *args: Any, **kwargs: Any) -> Any


   .. py:method:: markClosed(name: str) -> None


   .. py:method:: allClosed() -> bool


   .. py:method:: closeAll(onsuccess: collections.abc.Callable[[], None]) -> bool | None


   .. py:method:: register_dialog(name: str, creator: collections.abc.Callable | type, instance: Any | None = None) -> None

      Allows add-ons to register a custom dialog to be managed by Anki's dialog
      manager, which ensures that only one copy of the window is open at once,
      and that the dialog cleans up asynchronously when the collection closes

      Please note that dialogs added in this manner need to define a close behavior
      by either:

          - setting `dialog.silentlyClose = True` to have it close immediately
          - define a `dialog.closeWithCallback()` method that is called when closed
            by the dialog manager

      TODO?: Implement more restrictive type check to ensure these requirements
      are met

      Arguments:
          name {str} -- Name/identifier of the dialog in question
          creator {Union[Callable, type]} -- A class or function to create new
                                             dialog instances with

      Keyword Arguments:
          instance {Optional[Any]} -- An optional existing instance of the dialog
                                      (default: {None})



.. py:data:: dialogs

.. py:function:: setupLangAndBackend(pm: profiles.ProfileManager, app: QApplication, force: str | None = None, firstTime: bool = False) -> anki._backend.RustBackend

.. py:class:: NativeEventFilter

   Bases: :py:obj:`QAbstractNativeEventFilter`


   .. py:method:: nativeEventFilter(eventType: Any, message: Any) -> tuple[bool, Any | None]


.. py:class:: AnkiApp(argv: list[str])

   Bases: :py:obj:`QApplication`


   .. py:attribute:: appMsg


   .. py:attribute:: KEY
      :value: 'anki'



   .. py:attribute:: TMOUT
      :value: 30000



   .. py:method:: secondInstance() -> bool


   .. py:method:: sendMsg(txt: str) -> bool


   .. py:method:: onRecv() -> None


   .. py:method:: event(evt: QEvent | None) -> bool


   .. py:method:: eventFilter(src: Any, evt: QEvent | None) -> bool


.. py:function:: parseArgs(argv: list[str]) -> tuple[argparse.Namespace, list[str]]

   Returns (opts, args).


.. py:function:: setupGL(pm: profiles.ProfileManager) -> None

.. py:data:: PROFILE_CODE

.. py:function:: write_profile_results() -> None

.. py:function:: run() -> None

