MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / focusOutEvent

Method focusOutEvent

ElaWidgetTools/ElaPlainTextEdit.cpp:65–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63#ifndef QT_NO_CLIPBOARD
64 if (!isReadOnly())
65 {
66 action = menu->addElaIconAction(ElaIconType::KnifeKitchen, "剪切", QKeySequence::Cut);
67 action->setEnabled(!isReadOnly() && !textCursor().selectedText().isEmpty());
68 connect(action, &QAction::triggered, this, &ElaPlainTextEdit::cut);
69 }
70
71 action = menu->addElaIconAction(ElaIconType::Copy, "复制", QKeySequence::Copy);
72 action->setEnabled(!textCursor().selectedText().isEmpty());
73 connect(action, &QAction::triggered, this, &ElaPlainTextEdit::copy);
74
75 if (!isReadOnly())
76 {
77 action = menu->addElaIconAction(ElaIconType::Paste, "粘贴", QKeySequence::Paste);
78 action->setEnabled(!isReadOnly() && !QGuiApplication::clipboard()->text().isEmpty());
79 connect(action, &QAction::triggered, this, &ElaPlainTextEdit::paste);
80 }
81#endif
82 if (!isReadOnly())
83 {
84 action = menu->addElaIconAction(ElaIconType::DeleteLeft, "删除");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected