summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qinputcontrol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Make NSServicesMenuRequestor implementation rich-text awareTor Arne Vestbø2025-05-191-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | The protocol is used by services that interact with content in the application on behalf of the user. So far we have only been able to deal with plain text content, which resulted in wiping any formatting if the user tried to use a service to rewrite text in a rich text document. We now support rich text, by teaching our IM protocol how to deal with rich text for both reporting of the current text selection, as well as text insertion (commit). Unfortunately this doesn't help us for Writing Tools, as in 15.2 it no longer uses the NSServicesMenuRequestor protocol for insertion if we also implement NSTextInputClient. As a result we get insertions via insertText:replacementRange:, which is not prepared for rich text yet. [ChangeLog][macOS] Text services via the Services menu now support rich text extraction and insertion. Task-number: QTBUG-126238 Change-Id: I3d2933d766af8fe29e4f17636f703a257bf389fd Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* QtGui: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <[email protected]>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-1/+1
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* QInputControl: accept surrogate category characterLiang Qi2021-01-051-0/+3
| | | | | | | | | See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs . Fixes: QTBUG-89184 Pick-to: 6.0 5.15 Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c Reviewed-by: Lars Knoll <[email protected]>
* Introduce QInputControl::isCommonTextEditShortcutJoerg Bornemann2017-03-271-0/+51
| | | | | | | | | | | | | For handling ShortcutOverride events in text-edit-like controls one must know if a key event matches a common text edit short cut. The code that was formerly in QWidgetTextControl is now moved into QInputControl::isCommonTextEditShortcut to remove duplicated code in QtQuick and to avoid adding adding a third duplicate in QtWebEngine. Task-number: QTBUG-59053 Change-Id: I18723bb0224acd33c8ea4a8d0a601bb5e274a7a9 Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Accept all formatting characters as valid inputEskil Abrahamsen Blomfeldt2017-01-261-3/+3
| | | | | | | | | | | | Amends 7896ae052ad2c0c6ae2ebfc64cc2f525185198a8. The previous change focused only on ZWJ and ZWNJ, but there are many other formatting characters that we need to support and that may be rejected by the German keyboard-hack. This opens up for all characters in the Other_Format category. Task-number: QTBUG-58364 Change-Id: Idd967a9ae5b12060c851f6030b7e019508561696 Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Fix license header of QInputControlEskil Abrahamsen Blomfeldt2017-01-231-12/+18
| | | | | | | | | The license headers here were accidentally copied from Qt 5.6, since the files were targeted for that branch originally. This updates them to the proper LGPLv3 + GPLv2 + commercial. Change-Id: I0623bdbf8fd4475405500b2687ef8dce2f1dbb6b Reviewed-by: Simon Hausmann <[email protected]>
* Accept ZWNJ, ZWJ and PUA characters in input widgetsEskil Abrahamsen Blomfeldt2016-12-121-0/+82
Private Use Area characters are quite valid input characters when used in combination with a custom font. Joiners also serve an important language purpose in semitic writing systems. Note that there is a hack where we disregard any character produced using CTRL or CTRL+SHIFT specifically because of German keyboards. I have chosen to keep the hack in this patch to limit the change (though I have made an exception for ZWJ and ZWNJ since both are produced using Ctrl+Shift on Windows), but it will probably have to be reverted. [ChangeLog][QtWidgets][Input] Accept characters in Private Use Area, as well as zero-width joiners and zero-width non-joiners in input in QLineEdit and QTextEdit. Task-number: QTBUG-42074 Task-number: QTBUG-57003 Change-Id: I73f3b7d587a8670de24e902dc52a51f7721dba5a Reviewed-by: Simon Hausmann <[email protected]>