qRegisterMetaTypeStreamOperators missing in Qt6

592 views Asked by At

I am porting some Qt5 code to Qt6, and one of the functions called is qRegisterMetaTypeStreamOperators.

Compiling this code results in:

'qRegisterMetaTypeStreamOperators' was not declared in this scope

I assumed I just needed to include QMetaType, but that doesn't work. And I can't find reference to this function on the Qt website.

What am I missing?

1

There are 1 answers

0
Minh On BEST ANSWER

You can simply remove it.
Quoting from What's New in QMetaType + QVariant

Moreover, we considered the registries to be a bit clunky. After all, why should we require you to call QMetaType::registerEqualsComparator() when we could already know this by simply looking at the type? So in Qt 6, QMetaType::registerEqualsComparator, QMetaType::registerComparators, qRegisterMetaTypeStreamOperators and QMetaType::registerDebugStreamOperator have been removed. The metatype system will instead know about those automatically.