xTuple.com xTupleU Blog & News Customer Support

Qtforgroundrole To a specific color

How do i use qtforeground role to its fullest

CASE 
  WHEN release_priority = 'Hot' THEN 'error'
  WHEN release_priority = 'Priority' THEN 'warning' 
  ELSE ''
END AS qtforegroundrole,

I use this in my queries quite successfully. But I want to make the text blue? or Green? is there a way to put color names. or a place that I can find all the text options for qtforegroundrole?

The named color codes can be one of: error, warning, emphasis, altemphasis, expired, or future. Their hex color codes can be set using the settings on the users locale (in System > Setup > Locales). Additionally you can put anything that would be accepted in the QColor(string) constructor, which follows the same patterns as https://doc.qt.io/qt-5/qcolor.html#setNamedColor

1 Like

Worth mentioning, qtforegroundrole is for the row, release_priority_qtforegroundrole would color only the column named release_priority.

That is good to know. I knew there was some way to format columns as well but didn’t realize prepending the column name would do it.