MCPcopy Create free account
hub / github.com/Vector35/debugger / paint

Method paint

ui/breakpointswidget.cpp:175–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173
174
175void DebugBreakpointsItemDelegate::paint(
176 QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& idx) const
177{
178 painter->setFont(m_font);
179
180 bool selected = (option.state & QStyle::State_Selected) != 0;
181 if (selected)
182 painter->setBrush(getThemeColor(SelectionColor));
183 else
184 painter->setBrush(option.backgroundBrush);
185
186 painter->setPen(Qt::NoPen);
187
188 QRect textRect = option.rect;
189 textRect.setBottom(textRect.top() + m_charHeight + 2);
190 painter->drawRect(textRect);
191
192 auto data = idx.data(Qt::DisplayRole);
193 switch (idx.column())
194 {
195// case DebugBreakpointsListModel::EnabledColumn:
196 case DebugBreakpointsListModel::LocationColumn:
197 case DebugBreakpointsListModel::AddressColumn:
198 {
199 painter->setFont(m_font);
200 painter->setPen(option.palette.color(QPalette::WindowText).rgba());
201 painter->drawText(textRect, data.toString());
202 break;
203 }
204 default:
205 break;
206 }
207}
208
209
210void DebugBreakpointsItemDelegate::updateFonts()

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected