QQmlEngineDebugService: Avoid assert when debugging QModelIndex
QModelIndex is not streamable, so returning the input QVariant in
valueContents() will result in an assert.
We try to detect whether the input QVariant is a know value type
and then call the toString() meta-method on it. Otherwise, we fall
back to thge old behavior. This works since QModelIndex is exposed
to QML wrapped in an internal value type class (at least for the
time being).
Change-Id: I1a4c61b2bd441f823469dd73b31e86a1192f02e6
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>