Fix a multiple template instantiation problem on Windows and OSX
Summary:
This patch should fix the crash that happens on some versions of
Windows and OSX. The problem is that the templates are instantated in
different libraries and, therefore, dynamic_cast<> considers them to be
different types of objects
Test Plan: Compile and try to use Brush HUD
Reviewers: rempt, Krita
Reviewed By: rempt, Krita
Differential Revision: https://phabricator.kde.org/D2692