| 319 | } |
| 320 | |
| 321 | QRect ProjectItemDelegate::fileIconRect(int depth, const QRect &itemRect, const QModelIndex &index) const |
| 322 | { |
| 323 | QRect iconRect = itemRect; |
| 324 | iconRect.adjust(depth * kItemIndentation, 0, 0, 0); |
| 325 | QSize iconSize = view->iconSize(); |
| 326 | iconRect.setSize(iconSize); |
| 327 | |
| 328 | if (index.flags().testFlag(Qt::ItemIsUserCheckable)) { |
| 329 | const auto &checkRect = checkBoxRect(depth, itemRect); |
| 330 | iconRect.moveLeft(checkRect.right() + kItemSpacing); |
| 331 | } else { |
| 332 | const auto &ar = arrowRect(depth, itemRect); |
| 333 | iconRect.moveLeft(ar.right() + kItemSpacing); |
| 334 | } |
| 335 | iconRect.moveTop(iconRect.top() + ((itemRect.bottom() - iconRect.bottom()) / 2)); |
| 336 | |
| 337 | return iconRect; |
| 338 | } |
| 339 | |
| 340 | QRect ProjectItemDelegate::arrowRect(int depth, const QRect &itemRect) const |
| 341 | { |