Results 1 to 4 of 4

Thread: [SOLVED] QVariant and user structures

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    107
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    36
    Thanked 2 Times in 2 Posts

    Question [SOLVED] QVariant and user structures

    Hi,

    I have this structure:

    Qt Code:
    1. typedef struct
    2. {
    3. uint32 status_change_id;
    4. boolean result_code;
    5. uint8 reserved[3]; /* Set to 0 */
    6. } driver_id_receipt_data_type;
    To copy to clipboard, switch view to plain text mode 

    I'm trying to:
    Qt Code:
    1. driver_id_receipt_data_type receipt;
    2. QVariant packet;
    3. // after filling the structure's members with data...
    4. packet.setValue(receipt); // ERROR Line
    To copy to clipboard, switch view to plain text mode 

    Could somebody please tell me what's wrong with this code?

    I have this function:
    Qt Code:
    1. void send_FleetManagementPacket(QDataStream & dstream, QVariant packet);
    To copy to clipboard, switch view to plain text mode 
    which serves to send to arbitrary data to a stream.

    I was hoping to pass the data through a QVariant thus eliminating the need for a ton of orverloaded functions...

    TIA,
    Pedro
    Last edited by pdoria; 31st July 2009 at 14:51.

Similar Threads

  1. attaching user data pointer to images in QTextEdit
    By Workeml in forum Qt Programming
    Replies: 0
    Last Post: 7th November 2008, 20:06

Tags for this Thread

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.