void PatVerticalTabWidget::refreshIcons() { for(int i = 0; i < m_buttonGroup->buttons().size(); i++) { // TODO "done" not handled //imagePath = m_donePixmaps[i]; QAbstractButton * button = m_buttonGroup->button(i); QString imagePath; if(button->isEnabled() && button->isChecked()){ imagePath = m_selectedPixmaps[i]; } else if(button->isEnabled() && !button->isChecked()){ imagePath = m_unSelectedPixmaps[i]; } else if(!button->isEnabled() && button->isChecked()){ imagePath = m_selectedPixmaps[i]; } else if(!button->isEnabled() && !button->isChecked()){ imagePath = m_disabledPixmaps[i]; } else{ // you should not be here OS_ASSERT(false); } QString style; style.append("QPushButton { background-color: blue; background-image: url(\""); style.append(imagePath); style.append("\"); border: none; background-repeat: 0; }"); button->setStyleSheet(style); } }