| 71 | } |
| 72 | |
| 73 | bool GM_SettingsListWidget::containsUpdateIcon(const QPoint &pos) const |
| 74 | { |
| 75 | QListWidgetItem *item = itemAt(pos); |
| 76 | if (!item) |
| 77 | return false; |
| 78 | |
| 79 | GM_Script *script = static_cast<GM_Script*>(item->data(Qt::UserRole + 10).value<void*>()); |
| 80 | if (!script || script->downloadUrl().isEmpty()) |
| 81 | return false; |
| 82 | |
| 83 | const QRect rect = visualItemRect(item); |
| 84 | const int updateIconPosition = rect.right() - m_delegate->padding() * 2 - 16 * 2; |
| 85 | const int center = rect.height() / 2 + rect.top(); |
| 86 | const int updateIconYPos = center - (16 / 2); |
| 87 | |
| 88 | QRect updateIconRect(updateIconPosition, updateIconYPos, 16, 16); |
| 89 | |
| 90 | return updateIconRect.contains(pos); |
| 91 | } |
nothing calls this directly
no test coverage detected