Need to be aware of conflicting property settings and QSs (UI edit QSs, code Settings properties conflict)

Source: Internet
Author: User

Background-color:rgb (175175175);

Set this QSS for widgets in the UI editor,

Here is the setup again in the code

Qpalette Palette;palette.setcolor (Qpalette::background, Qcolor ("#2162a9"  )); Utitlebar->setpalette (palette);

Finally show what color is not, I thought is not because added dialog resizeevent problems, but in the absence of resizeevent, still colorless,

So judging the problem is not set correctly,

If you add a resezeevent in the

Qpalette Palette;palette.setcolor (Qpalette::background, Qcolor ("#2162a9"  )); Utitlebar->setpalette (palette);

This code, also can succeed, but a little awkward, finally found a problem,

Just get rid of the QSS and you can.

In another case, if you just added the QSS setting in the UI, but you still cannot explicitly do so in the dialog main form, you need to set the

Need to be aware of conflicting property settings and QSs (UI edit QSs, code Settings properties conflict)

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.