[gui] Merged PR from hebasto: qt6, test: Handle deprecated code https://github.com/bitcoin-core/gui/pull/839