How to disable pinentry-qt and use ksshaskpass instead?

When I run ssh from the command line, the pinentry-qt dialog is launched. How do I get it to launch ksshaskpass instead?

When I upgraded from Kubuntu 23.04 to 24.04 my working setup for automatically getting the ssh passphrase from the KWallet stopped working. I found out that instead of using what is in SSH_ASKPASS (such as ksshaskpass which I had before), it seems the system had changed from using OpenSSH to GnuPG for handling the ssh passphrase, hence the change of dialog from ksshaskpass to pinentry-qt. I installed the package kwalletcli and created ~/.gnupg/gpg-agent.conf with the following:

pinentry-program /usr/bin/pinentry-kwallet

Next time I typed in the SSH password, it offered to save it in KWallet. Added to my answer here: ssh agent - How do I set up KDE, KWallet and ssh so I'm not asked to enter my ssh passphrase? - Unix & Linux Stack Exchange