add discriminant type

Apparently needs to be cast as an explicit type to get dispatched under Qt 5.