2

I'm lost as to how to fix this :

  qRegisterMetaType<QVector<int>>("QVector<int>");

    QMap<int, QVariant> wah;
    wah[0] = QVariant::fromValue(QVector<int>{12, 231, 45, 125, 123, 12, 312, 4, 12});
    qDebug() << wah;

    QByteArray ar;
    QDataStream s(&ar, QIODevice::WriteOnly);
    s << wah;

Any ideas/help would be great. Most of the google results are about serializing custom classes and not ints :/

TIA!

Dariusz
  • 960
  • 13
  • 36

1 Answers1

2

Needed to add

qRegisterMetaTypeStreamOperators<QVector<int>>("QVector<int>");

Bit of a bummer that this is not explained in docs tho.

Dariusz
  • 960
  • 13
  • 36