I honestly don't know how one would do it elegantly - but the package should have qtkeychain as a mandatory dependency if it was built with qtkeychain support, and not have qtkeychain as a dependency at all otherwise.
qtkeychain
is indeed an optional dependency for drawpile when building it, but it is either a mandatory one or not a dependency at all once it's built (depending on whether it's built with or without it).
All things considered, maybe it should simply be a mandatory dependency - consider that Drawpile behaves weirdly without keychain support (it shows the "remember password" checkbox but it doesn't do anything when it's checked).
Pinned Comments