| 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, "删除"); |
nothing calls this directly
no outgoing calls
no test coverage detected