Sunday, July 6th 2008, 4:53pm UTC+1

You are not logged in.

  • Login
  • Register

1

Tuesday, April 22nd 2008, 5:10am

font color change for QToolButton

Hi,
I'm curious if there is any routine for changing the font color of a QToolButton at all? I was mistaken that I could use setColor, but to no avail. I'm only trying to change the default color from black to white (hopefully). Is there anything that could work? I would sincerely appreciate any help I can get. Thanks so much!
-Jeff



Here is my example constructor:

Button::Button(const QString &text, const QColor &color, QWidget *parent)
: QToolButton(parent)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
setText(text);
//set font color here to white?
QPalette newPalette = palette();
newPalette.setColor(QPalette::Button, color);
setPalette(newPalette);
}
  • Go to the top of the page

Rate this thread