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

Method actionFactory

src/common/widget/outputpane.cpp:244–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244QList<QAction *> OutputPane::actionFactory()
245{
246 QList<QAction *> list;
247
248 {
249 auto action = new QAction(this);
250 action->setText(tr("Copy"));
251 action->setEnabled(false);
252 connect(action, &QAction::triggered, [this]() {
253 if (!d->outputEdit->document()->toPlainText().isEmpty())
254 d->outputEdit->copy();
255 });
256 connect(d->outputEdit, &QPlainTextEdit::copyAvailable, action, &QAction::setEnabled);
257 list.append(action);
258 }
259
260 {
261 auto action = new QAction(this);
262 action->setText(tr("Clear"));
263 connect(action, &QAction::triggered, [this]() {
264 if (!d->outputEdit->document()->toPlainText().isEmpty())
265 d->outputEdit->clear();
266 });
267 list.append(action);
268 }
269
270 {
271 auto action = new QAction(this);
272 action->setText(tr("Select All"));
273 connect(action, &QAction::triggered, [this]() {
274 if (!d->outputEdit->document()->toPlainText().isEmpty())
275 d->outputEdit->selectAll();
276 });
277 list.append(action);
278 }
279
280 return list;
281}
282
283void OutputPane::updateFilter(const QString &filterText, bool caseSensitive, bool isRegexp)
284{

Callers

nothing calls this directly

Calls 9

connectFunction · 0.85
copyMethod · 0.80
selectAllMethod · 0.80
setTextMethod · 0.45
setEnabledMethod · 0.45
isEmptyMethod · 0.45
documentMethod · 0.45
appendMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected