def query_choice(
        self,
        msg: Optional[str],
        choices: Sequence['ChoiceItem'],
        *,
        title: Optional[str] = None,
        default_key: Optional[Any] = None,
    ) -> Optional[Any]:
        """Returns ChoiceItem.key (for selected item), or None if the user cancels the dialog.

        Needed by QtHandler for hardware wallets.
        """
        if title is None:
            title = _('Question')
        dialog = WindowModalDialog(self.top_level_window(), title=title)
        dialog.setMinimumWidth(400)
        choice_widget = ChoiceWidget(message=msg, choices=choices, default_key=default_key)
        vbox = QVBoxLayout(dialog)
        vbox.addWidget(choice_widget)
        cancel_button = CancelButton(dialog)
        vbox.addLayout(Buttons(cancel_button, OkButton(dialog)))
        cancel_button.setFocus()
        if not dialog.exec():
            return None
        return choice_widget.selected_key
Returns ChoiceItem.key (for selected item), or None if the user cancels the dialog.

        Needed by QtHandler for hardware wallets.
        
electrum/gui/qt/util.py