QLabel: set color of text and background

后端 未结 6 1653
清歌不尽
清歌不尽 2020-11-30 20:03

How do I set color of text and background of a QLabel ?

6条回答
  •  生来不讨喜
    2020-11-30 20:19

    The best way to set any feature regarding the colors of any widget is to use QPalette.

    And the easiest way to find what you are looking for is to open Qt Designer and set the palette of a QLabel and check the generated code.

提交回复
热议问题