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

Method focusInEvent

ElaWidgetTools/ElaPlainTextEdit.cpp:47–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46void ElaPlainTextEdit::contextMenuEvent(QContextMenuEvent* event)
47{
48 ElaMenu* menu = new ElaMenu(this);
49 menu->setMenuItemHeight(27);
50 menu->setAttribute(Qt::WA_DeleteOnClose);
51 QAction* action = nullptr;
52 if (!isReadOnly())
53 {
54 action = menu->addElaIconAction(ElaIconType::ArrowRotateLeft, "撤销", QKeySequence::Undo);
55 action->setEnabled(isUndoRedoEnabled() ? document()->isUndoAvailable() : false);
56 connect(action, &QAction::triggered, this, &ElaPlainTextEdit::undo);
57
58 action = menu->addElaIconAction(ElaIconType::ArrowRotateRight, "恢复", QKeySequence::Redo);
59 action->setEnabled(isUndoRedoEnabled() ? document()->isRedoAvailable() : false);
60 connect(action, &QAction::triggered, this, &ElaPlainTextEdit::redo);
61 menu->addSeparator();
62 }
63#ifndef QT_NO_CLIPBOARD
64 if (!isReadOnly())
65 {
66 action = menu->addElaIconAction(ElaIconType::KnifeKitchen, "剪切", QKeySequence::Cut);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected