Results 1 to 2 of 2

Thread: Problems with QDataStream

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problems with QDataStream

    If I try to unserialize a long int variable I get the error:
    "No match for 'operator>>' in *qdsDataStream >> Variable".
    If I make the variable a regular int (or unsigned) or a small it is just fine. If I make it any of the qint<size> or quint<size> it works fine. I'm using mingw on Windows and I think that int and long int are both 32 bits.

    ??

    It worked ok before and broke after I did some source code editing but I can't see what I changed that would cause this strange behavior.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problems with QDataStream

    As far as I remember "long int" is equivalent to "int" on 32b systems. You might want to use long long (or qlonglong) instead.

Similar Threads

  1. QDataStream and QHash<QString,QVariant> crash on read
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 15th July 2008, 12:14
  2. QDataStream question...
    By grellsworth in forum Qt Programming
    Replies: 10
    Last Post: 21st April 2008, 12:17
  3. QDataStream use
    By Doug Broadwell in forum Qt Programming
    Replies: 2
    Last Post: 21st July 2007, 22:17
  4. Using QDataStream
    By toratora in forum Qt Programming
    Replies: 1
    Last Post: 2nd May 2007, 15:35
  5. QDataStream >> QString
    By smalls in forum Qt Programming
    Replies: 2
    Last Post: 17th January 2006, 22:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.