Fix building on non-MSVC compilers

This function is inline, and QVariant uses a copy-on-write like copying mechanism, like most datatypes in Qt.