How change backcolor of pushbutton with text

Discussion about recent product features & solutions!
Search

Post Reply
2 posts • Page 1 of 1
Victor.Ermakov
Posts: 11
Joined: Fri Oct 20, 2017 6:50 am

How change backcolor of pushbutton with text

Post by Victor.Ermakov » Fri Apr 24, 2020 7:15 am

How change backcolor of pushbutton with text?

This sample works:
PUSH_NewAlarms.borderStyle=BS_NONE;
PUSH_NewAlarms.backCol="red";

It is required that the button border is not lost.

User avatar
adaneau
Posts: 212
Joined: Tue Feb 21, 2012 8:49 am

Re: How change backcolor of pushbutton with text

Post by adaneau » Mon Apr 27, 2020 8:52 am

Hi,

You can use stylesheet for this (see Style Sheets, basics in help).

Example:

Code: Select all

QPushButton[type = "myButtonTypeName"]
{
  border-radius: 5px;
  background-color: red;
  border-style: solid;
  border-width: 2px;
  border-color: black;
}
BR
Alexandre Daneau

Post Reply
2 posts • Page 1 of 1