| 25 | } |
| 26 | |
| 27 | bool IconCreator::insertIcon(const std::pair<int, std::string>& index_location) |
| 28 | { |
| 29 | bool isValid = false; |
| 30 | QIcon itemIcon = createIcon(index_location.second, IconCreator::m_icon_size); |
| 31 | if (itemIcon.isNull()) { |
| 32 | itemIcon = m_invalid_icon; |
| 33 | } |
| 34 | else |
| 35 | { |
| 36 | isValid = true; |
| 37 | } |
| 38 | |
| 39 | // Signals the model that the item has had a certain amount of icon changes. |
| 40 | requiresItemRefresh(index_location.first, itemIcon); |
| 41 | return isValid; |
| 42 | } |
| 43 | |
| 44 | QIcon IconCreator::createIcon(const std::string& filepath, const size_t size) |
| 45 | { |