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

Method addButtons

src/plugins/core/notify/gui/actionbutton.cpp:56–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56bool ActionButton::addButtons(const QStringList &list)
57{
58 if (list.isEmpty())
59 return false;
60
61 QString id;
62 for (int i = 0; i != list.size(); ++i) {
63 if (i % 2 == 0) {
64 id = list[i];
65 } else {
66 QAbstractButton *button { nullptr };
67 if (id.endsWith(DefaultButtonField))
68 button = new DSuggestButton(this);
69 else
70 button = new QPushButton(this);
71
72 button->setText(list[i]);
73 layout()->addWidget(button);
74
75 connect(button, &QPushButton::clicked, this, std::bind(&ActionButton::buttonClicked, this, id));
76 d->buttons << button;
77 }
78 }
79
80 return true;
81}
82
83QList<QAbstractButton *> ActionButton::buttonList()
84{

Callers 2

doProjectOpenMethod · 0.80
updateContentMethod · 0.80

Calls 6

connectFunction · 0.85
endsWithMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45
setTextMethod · 0.45
addWidgetMethod · 0.45

Tested by

no test coverage detected