Use Cocoa actions for search field copy/cut/paste instead of trying to reimplement the same thing with some Qt.

So unlike previously, actions now also works as expected if some part of the text is selected, or if some text is already present (for paste action: doesn't replace previous text)
This commit is contained in:
Arnaud Bienner 2015-10-15 19:45:08 +02:00
parent 5984c881c6
commit ab8c6dbb69

View File

@ -146,21 +146,17 @@ public:
}
else if (keyString == "c") // Cmd+c
{
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(toQString([self stringValue]));
[[self currentEditor] copy: nil];
return YES;
}
else if (keyString == "v") // Cmd+v
{
QClipboard* clipboard = QApplication::clipboard();
[self setStringValue:fromQString(clipboard->text())];
[[self currentEditor] paste: nil];
return YES;
}
else if (keyString == "x") // Cmd+x
{
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(toQString([self stringValue]));
[self setStringValue:@""];
[[self currentEditor] cut: nil];
return YES;
}
}