QToolButton *button = new QToolButton(this); button->setStyleSheet("QToolButton {background-color: blue;}");
QToolButton *button = new QToolButton(this); button->setStyleSheet("QToolButton {background-color: blue;}" "QToolButton::menu-indicator{image: url(/path/to/image.png);}");In this example, along with changing the background color of the tool button, we also changed the menu indicator icon to a custom image using setStyleSheet() function. Package library: QtWidgets.