- On MAC, I have a qPushButton with a background color. So essentially the whole button is of a certain color.
- When I tab to this button, I cannot see the button surrounded by a blue highlight as is normally the case when tabbing across widgets. The QPushButton is accessible from the keyboard i.e. I can press enter when I have tabbed to that button, but just can't see the highlight!
- Is there something that has to be set to push the background color into the 'background' so that the highlight can be seen?
To set the color I did the following:
myButton->setAutoFillBackground(TRUE);
QPalette myPalette
= myButton
->palette
();
myPalette.
setColor(QPalette::Button, Qt
:Green
);
myPalette.
setColor(QPalette::Window,Qt
:Green
);
myButton->setPalette(myPalette);
myButton->setAutoFillBackground(TRUE);
QPalette myPalette = myButton->palette();
myPalette.setColor(QPalette::Button, Qt:Green);
myPalette.setColor(QPalette::Window,Qt:Green);
myButton->setPalette(myPalette);
To copy to clipboard, switch view to plain text mode
Thanks in advance
Bookmarks