Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMap wont serialize in QDataStream without include QVariant

QMap wont serialize in QDataStream without include QVariant

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 664 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jcbritobr
    wrote on last edited by
    #1

    Hi guys, im new in qt, im've noted that the compiler emit an error when trying to serialize a QMap without QVariant header:

    @QDataStream& operator <<(QDataStream& out, const UserData& ud){
    out << ud.getUserName() << ud.getUserKey() << ud.getKeys();
    return out;
    }@

    /Users/aldebaran/QtProjects/chaveiro/userdata.cpp:4: error: invalid operands to binary [removed]'QDataStream' and 'QMap<qint8, QString>')
    out << ud.getUserName() << ud.getUserKey() << ud.getKeys();
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~

    is this normal?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved