MCPcopy Create free account
hub / github.com/KDE/kdevelop / drawBranchName

Method drawBranchName

plugins/projectmanagerview/projectmodelitemdelegate.cpp:117–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void ProjectModelItemDelegate::drawBranchName(QPainter* painter, const QStyleOptionViewItem& option,
118 const QRect& rect, const QString& branchName) const
119{
120 QString text = option.fontMetrics.elidedText(branchName, Qt::ElideRight, rect.width());
121
122 bool selected = option.state & QStyle::State_Selected;
123 QPalette::ColorGroup colorGroup = selected ? QPalette::Active : QPalette::Disabled;
124 painter->save();
125 painter->setPen(option.palette.color(colorGroup, QPalette::Text));
126 painter->drawText(rect, text);
127 painter->restore();
128}
129
130void ProjectModelItemDelegate::drawStyledBackground(QPainter* painter, const QStyleOptionViewItem& option) const
131{

Callers

nothing calls this directly

Calls 1

saveMethod · 0.45

Tested by

no test coverage detected