[Interest] set background color for toolButton

Graham Labdon Graham.Labdon at avalonsciences.com
Thu Aug 8 14:48:27 CEST 2013


Hi
I am trying to set the background colour for a checkable QToolButton -

  1.  void test2::on_toolButton_clicked()
  2.  {
  3.    if (!ui.toolButton->isChecked())
  4.    {
  5.     ui.toolButton->setStyleSheet("background-color: green");
  6.    }
  7.    else
  8.    {
  9.     ui.toolButton->setStyleSheet("background-color: red");
  10.   }
  11. }
First time this gets called the color is solid green
The next time the color gets set to red, but it not solid, it seems to be cross hatched with white
Can anyone tell me why this might happen?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130808/e10d9467/attachment.html>


More information about the Interest mailing list