MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / makeCheckBoxDecorator

Function makeCheckBoxDecorator

src/gui/widgets/template_list_widget.cpp:109–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107namespace {
108
109QVariant makeCheckBoxDecorator(QStyle* style, const QSize& size)
110{
111 QCheckBox header_check;
112 header_check.setChecked(true);
113 header_check.setEnabled(false);
114 QPixmap pixmap(size);
115 pixmap.fill(Qt::transparent);
116 QPainter painter(&pixmap);
117 QStyleOptionViewItem option_item;
118 option_item.rect = { {0, 0}, size };
119 style->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option_item, &painter, nullptr);
120 painter.end();
121 return pixmap;
122}
123
124/**
125 * Returns a new QToolButton with a unified appearance.

Callers 1

TemplateListWidgetMethod · 0.85

Calls 4

fillMethod · 0.80
drawPrimitiveMethod · 0.80
setEnabledMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected