I have got a weird problem.

I need to have some buttons in my QTableView. I used to use QAbstractItemView::setIndexWidget() method, but it is not very responsible when working with larger models. Therefore I decided to switch to QStyledItemDelegate. My buttons have icons (and icons only, no text). When working with setIndexWidget, I used the following code:
Qt Code:
  1. ClientDetailsButton::ClientDetailsButton(const Client* _client,
  2. QWidget* _parent) :
  3. QPushButton("", _parent),
  4. __current(_client) {
  5.  
  6. setIcon(QIcon(":/uiIcons/button-details.png"));
  7. }
To copy to clipboard, switch view to plain text mode 
And it worked perfectly. But when I switch to delegate, I use it like that:
Qt Code:
  1. button.rect = _option.rect;
  2. button.text.clear();
  3. button.icon = QIcon(":/uiIcons/button-details.png");
  4. button.state = _option.state | QStyle::State_Enabled;
  5.  
  6. if (_index == __button)
  7. button.state |= QStyle::State_Sunken;
  8.  
  9. QApplication::style()->drawControl(QStyle::CE_PushButton, &button, _painter);
To copy to clipboard, switch view to plain text mode 
The button itself is fine, but its empty. There is no icon visible. Suprisingly, when I use, for example:
Qt Code:
  1. button.icon = QIcon::fromTheme("dialog-information", QIcon(":/uiIcons/button-details.png"));
To copy to clipboard, switch view to plain text mode 
the theme icon is visible. But if Qt cannot find the theme icon, the replacement is still blank. I tried everything I could think of and have no idea why it doesn't work. Anyone has any ideas?