Qlcdnumber setting the background color and displaying the number color

Source: Internet
Author: User
Tags set background

only see the landlord in reverse reading landlord posted: 2013-10-22 LCD timeShow
Qlcdnumber *m_plcdtime = new Qlcdnumber (this);
Set to display several numbers
M_plcdtime->setdigitcount (19);
Set numberFont: Outline, contour prominent,Color isBackground color, Filled, internal filling type, black color, Flat, flat type
M_plcdtime->setsegmentstyle (Qlcdnumber::flat);
Palette
Qpalette Lcdpat = M_plcdtime->palette ();
/* Set color, the overall background color color blue, the first of this functionParameters can be set a variety of. such as text, button button text, multiple */
Lcdpat.setcolor (qpalette::normal,qpalette::windowtext,qt::red);
Sets the color palette for the current window
M_plcdtime->setpalette (LCDPAT);
Set Background color
M_plcdtime->setstylesheet ("
M_plcdtime->display (Qdatetime::currentdatetime (). toString ("Yyyy-mm-dd hh:mm:ss"));

When setting a number color, be aware that the Flat property is selected in the function Setsegmentstyle (Qlcdnumber::flat), otherwise it does not take effect when the number color is set in SetColor ()
Set the background color directly with the Setstylesheet () function to set it.

Operating effect:

Qlcdnumber setting the background color and displaying the number color

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.