summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview_complextext.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-08-16 10:59:13 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-08-16 19:26:29 +0200
commitd4015a21a4b7bfc1fb982ecfae1b25d1b21a5005 (patch)
tree09d84786d55e5253a9d24c47ecc4d2068a7e75a3 /src/plugins/platforms/cocoa/qnsview_complextext.mm
parent853c350cca4e00d2f890672ad8144a55ad75541e (diff)
macOS: Add logging for keyboard and complex text input
Pick-to: 6.2 Change-Id: I098829e051d4f63950b2e35ee6dd4def8d70cf01 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview_complextext.mm')
-rw-r--r--src/plugins/platforms/cocoa/qnsview_complextext.mm18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_complextext.mm b/src/plugins/platforms/cocoa/qnsview_complextext.mm
index 48cea12a14..fb19270017 100644
--- a/src/plugins/platforms/cocoa/qnsview_complextext.mm
+++ b/src/plugins/platforms/cocoa/qnsview_complextext.mm
@@ -46,6 +46,9 @@
if (m_composingText.isEmpty())
return;
+ qCDebug(lcQpaKeys) << "Canceling composition" << m_composingText
+ << "for focus object" << m_composingFocusObject;
+
if (m_composingFocusObject) {
QInputMethodQueryEvent queryEvent(Qt::ImEnabled);
if (QCoreApplication::sendEvent(m_composingFocusObject, &queryEvent)) {
@@ -62,6 +65,11 @@
- (void)unmarkText
{
+ // FIXME: Match cancelComposingText in early exit and focus object handling
+
+ qCDebug(lcQpaKeys) << "Unmarking" << m_composingText
+ << "for focus object" << m_composingFocusObject;
+
if (!m_composingText.isEmpty()) {
if (QObject *fo = m_platformWindow->window()->focusObject()) {
QInputMethodQueryEvent queryEvent(Qt::ImEnabled);
@@ -85,17 +93,20 @@
- (void)insertNewline:(id)sender
{
Q_UNUSED(sender);
+ qCDebug(lcQpaKeys) << "Inserting newline";
m_resendKeyEvent = true;
}
- (void)doCommandBySelector:(SEL)aSelector
{
+ qCDebug(lcQpaKeys) << "Trying to perform command" << aSelector;
[self tryToPerform:aSelector with:self];
}
- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
{
- Q_UNUSED(replacementRange);
+ qCDebug(lcQpaKeys).nospace() << "Inserting \"" << aString << "\""
+ << ", replacing range " << replacementRange;
if (m_sendKeyEvent && m_composingText.isEmpty() && [aString isEqualToString:m_inputSource]) {
// don't send input method events for simple text input (let handleKeyEvent send key events instead)
@@ -129,7 +140,10 @@
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange
{
- Q_UNUSED(replacementRange);
+ qCDebug(lcQpaKeys).nospace() << "Marking \"" << aString << "\""
+ << " with selected range " << selectedRange
+ << ", replacing range " << replacementRange;
+
QString preeditString;
QList<QInputMethodEvent::Attribute> attrs;