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
|
else if (keyString == "c") // Cmd+c
|
||||||
{
|
{
|
||||||
QClipboard* clipboard = QApplication::clipboard();
|
[[self currentEditor] copy: nil];
|
||||||
clipboard->setText(toQString([self stringValue]));
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else if (keyString == "v") // Cmd+v
|
else if (keyString == "v") // Cmd+v
|
||||||
{
|
{
|
||||||
QClipboard* clipboard = QApplication::clipboard();
|
[[self currentEditor] paste: nil];
|
||||||
[self setStringValue:fromQString(clipboard->text())];
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else if (keyString == "x") // Cmd+x
|
else if (keyString == "x") // Cmd+x
|
||||||
{
|
{
|
||||||
QClipboard* clipboard = QApplication::clipboard();
|
[[self currentEditor] cut: nil];
|
||||||
clipboard->setText(toQString([self stringValue]));
|
|
||||||
[self setStringValue:@""];
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user