Nominate our 2022 Qt Champions!

SetPalette() for QLCDnumber

  • Hi everyone, I tried to change the font color of the QLCDnumber into some certain color such as red and dark yellow. (Such as the code below)


    I understand that setPalette(Qt:: LALALA) where LALALA is a fixed range of color.
    However, I would like to change to certain other colour such as Orange or Brown. Do I have to manipulate QBrush or QColor to achieve this?

  • @Faruq

    Hi everyone, I have solved it. So instead of my 1st post entry. I decided to use QColor to replace the Qt::LALALA where LALALA is the certain fixed range of colors as shown in the documentation.


    Do take note that the transparency is at the last digit ( 0 = full transparentcy while 255 is the full opaque)

    Whatever it is i encountered a puzzled response when i input
    QColor c1=(255,165,0,255);

    It became blue/Dark blue no matter what number I tried. Puzzling but worth for others to know. Hope It is useful to the new sheeps like myself. :)

Log in to reply