<SOLVED>Set background color for toolButton



  • Hi
    I am trying to set the background colour for a checkable QToolButton -
    @
    void test2::on_toolButton_clicked()
    {
    if (!ui.toolButton->isChecked())
    {
    ui.toolButton->setStyleSheet("background-color: green");
    }
    else
    {
    ui.toolButton->setStyleSheet("background-color: red");
    }
    }
    @

    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



  • I need to specify border: none


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.