Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Value ranges in QColor
Forum Updated to NodeBB v4.3 + New Features

Value ranges in QColor

Scheduled Pinned Locked Moved General and Desktop
qcolornatvis
1 Posts 1 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TuggiT Offline
    TuggiT Offline
    Tuggi
    wrote on last edited by Tuggi
    #1

    Hi all,

    I want to enhance my qt5.natvis file for VS2013. I added a section as follows:

    <Type Name="QColor">
       <DisplayString Condition="QColor::Rgb  == cspec">{{ r={(ct.argb.red   * 255) / 65535} g={(ct.argb.green      * 255) / 65535} b={(ct.argb.blue      * 255) / 65535} }}</DisplayString>
       <DisplayString Condition="QColor::Hsv  == cspec">{{ h={(ct.ahsv.hue   * 359) / 65535} s={(ct.ahsv.saturation * 255) / 65535} v={(ct.ahsv.value     * 255) / 65535} }}</DisplayString>
       <DisplayString Condition="QColor::Cmyk == cspec">{{ c={(ct.acmyk.cyan * 255) / 65535} m={(ct.acmyk.magenta   * 255) / 65535} y={(ct.acmyk.yellow   * 255) / 65535} k={(ct.acmyk.black * 255) / 65535} }}</DisplayString>
       <DisplayString Condition="QColor::Hsl  == cspec">{{ h={(ct.ahsl.hue   * 359) / 65535} s={(ct.ahsl.saturation * 255) / 65535} l={(ct.ahsl.lightness * 255) / 65535} }}</DisplayString>   
    </Type>
    

    I want my debugger to show the color values within the valid range ( typ. [0..255] ). But as QColor stores the values in ushort format, I guess that the value ist scaled; i.e. 65535 in QColor stands for 255 in RGB code.
    So I want to know, if my assumption is correct.
    Thank's very much

    Sören

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved