Results 1 to 3 of 3

Thread: Qcolor as Hex format ?

  1. #1
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Qcolor as Hex format ?

    Hi all,

    I need to pass the color value in hex format as (0XAARRGGBB) to my function.

    Qcolor.name provides the result as #RRGGBB format as string value

    Is there any way, i will get a hex format 0xAARRGGBB with Qcolor.


    Regards,
    Augus.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qcolor as Hex format ?

    Hi, you can use QColor::rgba() and convert the QRgb to a string.

    Ginsengelf

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

    augusbas (27th January 2011)

  4. #3
    Join Date
    Jan 2008
    Location
    Wiesbaden/Germany
    Posts
    4
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qcolor as Hex format ?

    Use QColor::name (). s. docu :-)
    Valentin Heinitz
    D-65197 Wiesbaden
    Mobile: +49(0)160 950-39-758
    Web: http://heinitz-it.de

Similar Threads

  1. Replies: 1
    Last Post: 14th January 2011, 11:57
  2. QColor PushButton
    By jmqt in forum Newbie
    Replies: 8
    Last Post: 21st July 2009, 10:30
  3. QColor in QtScript
    By Kingofhearts_sri in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2009, 14:50
  4. bug with QColor(QString& name)
    By Radagast in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2008, 14:24
  5. MFC PALLETEINDEX to QColor()
    By maverick_pol in forum Qt Programming
    Replies: 8
    Last Post: 24th September 2007, 07:10

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.