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

Method paintEvent

ElaWidgetTools/ElaLineEdit.cpp:109–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107{
108 ElaMenu* menu = new ElaMenu(this);
109 menu->setMenuItemHeight(27);
110 menu->setAttribute(Qt::WA_DeleteOnClose);
111 QAction* action = nullptr;
112 if (!isReadOnly())
113 {
114 action = menu->addElaIconAction(ElaIconType::ArrowRotateLeft, tr("撤销"), QKeySequence::Undo);
115 action->setEnabled(isUndoAvailable());
116 connect(action, &QAction::triggered, this, &ElaLineEdit::undo);
117
118 action = menu->addElaIconAction(ElaIconType::ArrowRotateRight, tr("恢复"), QKeySequence::Redo);
119 action->setEnabled(isRedoAvailable());
120 connect(action, &QAction::triggered, this, &ElaLineEdit::redo);
121 menu->addSeparator();
122 }
123#ifndef QT_NO_CLIPBOARD
124 if (!isReadOnly())
125 {
126 action = menu->addElaIconAction(ElaIconType::KnifeKitchen, tr("剪切"), QKeySequence::Cut);
127 action->setEnabled(!isReadOnly() && hasSelectedText() && echoMode() == QLineEdit::Normal);

Callers

nothing calls this directly

Calls 1

onThemeChangedMethod · 0.45

Tested by

no test coverage detected