aqt.notetypechooser#

Classes#

NotetypeChooser

Unlike the older modelchooser, this does not modify the "current model",

Module Contents#

class aqt.notetypechooser.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: 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.

mw#
on_notetype_changed = None#
property selected_notetype_id: anki.models.NotetypeId#
cleanup() None#
reset_state() None#
show() None#
hide() None#
onEdit() None#
choose_notetype() None#
selected_notetype_name() str#
on_operation_did_execute(changes: anki.collection.OpChanges, handler: object | None) None#