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:
parent
5984c881c6
commit
ab8c6dbb69
10
3rdparty/qocoa/qsearchfield_mac.mm
vendored
10
3rdparty/qocoa/qsearchfield_mac.mm
vendored
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user