Results 1 to 3 of 3

Thread: Hex Zero

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    518
    Thanks
    13
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Hex Zero

    Hi, you can use one of the QString::arg() methods. They allow to specify a minimum width of the result.

    Ginsengelf

  2. The following user says thank you to Ginsengelf for this useful post:

    johnmauer (17th June 2010)

  3. #2
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hex Zero

    Works great. Thanks.

    Qt Code:
    1. QString fontColorSet = "#%1%2%3";
    2. fontColorSet = fontColorSet.arg(QString::number(fontColor.red(), 16), 2,'0')
    3. .arg(QString::number(fontColor.green(), 16) ,2,'0')
    4. .arg(QString::number(fontColor.blue(), 16),2,'0');
    To copy to clipboard, switch view to plain text mode 

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.