aqt.notetypechooser
===================

.. py:module:: aqt.notetypechooser


Classes
-------

.. autoapisummary::

   aqt.notetypechooser.NotetypeChooser


Module Contents
---------------

.. py:class:: NotetypeChooser(*, mw: aqt.AnkiQt, widget: QWidget, starting_notetype_id: anki.models.NotetypeId, on_button_activated: collections.abc.Callable[[], None] | None = None, on_notetype_changed: collections.abc.Callable[[anki.models.NotetypeId], None] | None = None, show_prefix_label: bool = True)

   Bases: :py:obj:`QHBoxLayout`


   Unlike the older modelchooser, this does not modify the "current model",
   so changes made here do not affect other parts of the UI. To read the
   currently selected notetype id, use .selected_notetype_id.

   By default, a chooser will pop up when the button is pressed. You can
   override this by providing `on_button_activated`. Call .choose_notetype()
   to run the normal behaviour.

   `on_notetype_changed` will be called with the new notetype ID if the user
   selects a different notetype, or if the currently-selected notetype is
   deleted.


   .. py:attribute:: mw


   .. py:attribute:: on_notetype_changed
      :value: None



   .. py:property:: selected_notetype_id
      :type: anki.models.NotetypeId



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


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


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


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


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


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


   .. py:method:: selected_notetype_name() -> str


   .. py:method:: on_operation_did_execute(changes: anki.collection.OpChanges, handler: object | None) -> None


