MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / initEntitiesButtons

Method initEntitiesButtons

dialog/htmlentitiesdialog.cpp:123–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122
123void HtmlEntitiesDialog::initEntitiesButtons() {
124 int row = 0;
125 int column = 0;
126 QStringList *ptr;
127 if (entities.size() > 0)
128 ptr = &entities;
129 else
130 ptr = &defaultEntities;
131 for (int i=0; i<ptr->size(); i++) {
132 column = i % ENTITY_BUTTON_COLUMNS;
133 if (column == 0)
134 row++;
135 QTextDocument doc;
136 doc.setHtml(ptr->at(i));
137 QString htmlText = doc.toPlainText();
138 QPushButton *button = new QPushButton(htmlText);
139 signalmapper->setMapping(button, ptr->at(i));
140 connect(button, SIGNAL(clicked()), signalmapper, SLOT(map()));
141 button->setMinimumHeight(ENTITY_BUTTON_HEIGHT);
142 button->setMinimumWidth(ENTITY_BUTTON_WIDTH);
143 entitiesGrid->addWidget(button,row, column);
144 buttonList.append(button);
145 }
146}
147
148void HtmlEntitiesDialog::initEntitiesWidget() {
149 entitiesWidget = new QWidget();

Callers

nothing calls this directly

Calls 2

addWidgetMethod · 0.80
setHtmlMethod · 0.45

Tested by

no test coverage detected