MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / fileIconRect

Method fileIconRect

src/plugins/smartut/common/projectitemdelegate.cpp:321–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321QRect 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
340QRect ProjectItemDelegate::arrowRect(int depth, const QRect &itemRect) const
341{

Callers

nothing calls this directly

Calls 5

rightMethod · 0.80
topMethod · 0.80
bottomMethod · 0.80
setSizeMethod · 0.45
flagsMethod · 0.45

Tested by

no test coverage detected