Results 1 to 2 of 2

Thread: integer to its binary representation QString

  1. #1
    Join Date
    Jul 2006
    Posts
    36
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default integer to its binary representation QString

    Hi all;

    are there any class I can use to convert an integer to its binary representation QString.
    I am using
    std::bitset<Precision> myStringOfBits=myInteger;

    the problem with this method is Precision must be declared constant:

    static const unsigned Precision = 8;

    Last edited by QiT; 2nd April 2007 at 19:18.
    power of mind > mind of power

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: integer to its binary representation QString

    How about:
    Qt Code:
    1. QString myStringOfBits( QString::number( myInteger, 2 ) );
    To copy to clipboard, switch view to plain text mode 
    ?

  3. The following 2 users say thank you to jacek for this useful post:

    QiT (3rd April 2007), Seishin (9th February 2016)

Similar Threads

  1. setRasterOp Equivalent
    By vermarajeev in forum Qt Programming
    Replies: 22
    Last Post: 31st March 2007, 14:13
  2. Replies: 2
    Last Post: 23rd April 2006, 02:02
  3. what's the equivalent with DPtoLP in windows
    By cocalele in forum Qt Programming
    Replies: 6
    Last Post: 1st March 2006, 07:57
  4. make install equivalent in qmake ...
    By momesana in forum Newbie
    Replies: 3
    Last Post: 20th February 2006, 22:46
  5. PostMessage() across process boundaries equivalent
    By TheKedge in forum Qt Programming
    Replies: 9
    Last Post: 27th January 2006, 01:02

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.