Results 1 to 13 of 13

Thread: true representation in binary or hex

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    22
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default true representation in binary or hex

    Hi, I have made server which sends true value to device, but I'm looking for solution, how to do this differently. this code works fine
    Qt Code:
    1. QDataStream out(&ba, QIODevice::WriteOnly);
    2. out << true;
    3. clientConnection->write(ba);
    To copy to clipboard, switch view to plain text mode 

    how to change this line:
    out << true;
    to something like this
    out << 01; //this is not working

    I'm wondering how can I achieve same result by not using Boolean value true?
    Or maybe it is possible to do the same without QDataStream and QByteArray
    just do something like this:
    clientConnection->write("1") // this is not working

    Thanks for advice
    Last edited by Tadas; 7th October 2010 at 21:18.

Similar Threads

  1. Graphical representation of an array
    By ithinkso in forum Qt Programming
    Replies: 2
    Last Post: 5th March 2010, 23:30
  2. QTabWidget and .setTabsClosable(True)
    By prof.ebral in forum Newbie
    Replies: 3
    Last Post: 26th February 2010, 04:36
  3. Tree related representation
    By aegis in forum Qt Programming
    Replies: 1
    Last Post: 12th August 2007, 12:20
  4. Replies: 1
    Last Post: 2nd April 2007, 22:52
  5. Replies: 12
    Last Post: 7th February 2007, 13:30

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.