summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qwidgettextcontrol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Android: Do not enable text selection in QTextEdits by default.Christian Strømme2014-02-211-0/+4
| | | | | | | | | Text selection does not work correctly and is currently causing selected text to be randomly copied, pasted or deleted. Task-id: QTBUG-34616 Change-Id: I98678b7575034325dd8a4fa181ee4cb182783a3b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Extending the inputMethodQuery APIPaul Olav Tvete2014-02-151-1/+42
| | | | | | | | | | | | | | Currently, inputMethodQuery() only provides information about the current paragraph. On some platforms, such as Android, the input method needs information about the global cursor position, and more of the surrounding text. Some queries need to pass parameters. The current inputmethodQuery() implementation does not allow parameters to be passed. Changing this would require new or modified virtual functions, which is not possible until Qt 6. Therefore, a completely new mechanism is needed. Change-Id: Ic64fd90198ade70aa0fa6fa5ad3867dfa7ed763c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Q(Plain)TextEdit: Add find() overload with QRegExpChristian Loose2014-01-311-0/+13
| | | | | | | | | | | | | | | Add overloads to the find() methods in QPlainTextEdit and QTextEdit that find the next occurrence matching the passed regular expression. These are convenience methods that eliminate the need to use the document() method and the need to handle the QTextCursor return value. [ChangeLog][QtWidgets][QPlainTextEdit] Added find method overload using QRegExp [ChangeLog][QtWidgets][QTextEdit] Added find method overload using QRegExp Change-Id: Ia6139b771e3ae4ca02e4b8ea7fde19e5dc71b9d8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Add new BiDi control characters to Unicode control character menuKonstantin Ritt2014-01-141-1/+5
| | | | | | Change-Id: I0e3253965b36c7c831f0212c6e55ca310a3ad6c4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QWidgetTextControl: drop some actions when QT_NO_CLIPBOARDMarc Mutz2013-12-091-1/+5
| | | | | | | | | Drop the Cut, Copy, and Copy Link Address actions from the context menu for QT_NO_CLIPBOARD builds. This mirrors what QWidgetLineControl already does. Change-Id: Icd6e92c044a11d336fb8d7fbf54b826712bd240e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Assign icons to actions of QTextEdit context menuAurélien Gâteau2013-07-301-0/+13
| | | | | | | Icons are only set if they are valid. Change-Id: I7637dec18b3066930455a2f6fd40d87097eb20f7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Only call QA::updateAccessibility() if the "control owner" is a QWidgetJan Arve Saether2013-05-201-2/+2
| | | | | | | | | | | | | QGraphicsItems are not accessible, and calling updateAccessibility() with a QGraphicsTextItem caused the accessibility framework to try to load a plugin for QGraphicsTextItem. Since that was not found, it dumped this on the console: "Cannot create accessible interface for object: QGraphicsTextItem" Task-number: QTBUG-29720 Change-Id: I4aaa08ee6e97f03617fa08da0c6ef35992efdebf Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update the display to reflect changes by input methodPaul Olav Tvete2013-02-271-1/+2
| | | | | | | Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Change-Id: If3804f2a514ba4635f841de6377f2b328a4e928a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* compile fix for MSVC 2008 and std::upper_boundThomas Hartmann2012-10-041-10/+11
| | | | | | | | | | | | qUpperBound was replaced by std::upper_bound. Unfortunately the STL of MSVC 2008 enforces the definition of the operator in both directions. Change-Id: I3e0f775c23e43332d106e0847d3611e488da6c06 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Remove qUpperBound usages from qtbaseGiuseppe D'Angelo2012-09-191-2/+2
| | | | | | | | | Replace them with std::upper_bound; this allows for deprecation of qUpperBound. Change-Id: Idef01d2228b9a70eee3d52931d7aedb5bb6ba902 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove qLowerBound usages from qtbaseGiuseppe D'Angelo2012-09-191-2/+4
| | | | | | | | | Replace them with std::lower_bound; this allows for deprecation of qLowerBound. Change-Id: I536e7338eb85ea6c7c1a5bf23121292767927e0b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Don't use string comparison to figure out how to use the clipboardJorgen Lind2012-09-051-3/+4
| | | | | Change-Id: I36738b3808ebed0d108882ebdc74ee7dd1899bfd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move assignment of mousePressed variable in QWidgetTextControlJorgen Lind2012-09-051-1/+2
| | | | | | | | Or else we never hit the path where middle button click pasts selection on X11. This is also how it worked in Qt 4. Change-Id: Ia090c465db0e5e8cb249f5d752e0bb86951e2eb0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Replace some Q_WS_X11 by check for platform's name.Friedemann Kleint2012-07-161-2/+1
| | | | | Change-Id: I33d7ce31e01c355e0d9e05c98d6a84ea4f6d5bbd Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Add stylehint to use querying RTL keyboard support.Friedemann Kleint2012-07-111-11/+2
| | | | | Change-Id: Ic58ed7cb64cc7fe60b4d431e9f29e389c62265fc Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Avoid string-based lookup of signalsKent Hansen2012-06-051-2/+3
| | | | | | | Resolving signals by member function is preferable. Change-Id: I2a47a27bc780c4c3c29cf472f9f063c910e20c18 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update accessibility selections in QTextControl.Frederik Gladhorn2012-04-141-3/+17
| | | | | | | | Forwardport from Qt 4. Change-Id: Iae0c2792b64b8ec2736a9ff621cf7c313a394093 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> (cherry picked from commit d5649547d641b9c5af3c3f814caf8e1ab5bf9f47)
* Reverted use of tentative commit use in QWidget editorsPekka Vuorela2012-03-271-14/+5
| | | | | | | | | Feature to be reimplemented simplified. Cases when input method needs to be reset with possibility to commit use QInputMethod::commit() again. Change-Id: Ibfe7aecc0799e7a76c7ac4f5d860971cfe6e97ca Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fix QWidgetTextController issue when used with QtQuick1 TextEditPekka Vuorela2012-03-211-2/+2
| | | | | | | | | Calling QInputMethod::invokeAction() was not checking for proper event type and was requiring context widget unnecessarily. Fixes some parts of QTBUG-24035 Change-Id: I51fe9ed02a018ced36319eb672a088503649b275 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Remove use of deprecated conversion from QKeySequenceOlivier Goffart2012-02-271-1/+3
| | | | | | | Note: UNICODE_ACCEL is Qt3 compatibility and is equal to 0 Change-Id: I808a66772abceb3822d515d69386728264eb1b40 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix compilation with QT_NO_PRINTER.Andreas Holzammer2012-02-071-0/+2
| | | | | Change-Id: Iacfa47b8d384461ce08202a9a8e1642288cbe1e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Renamed QInputPanel as QInputMethodPekka Vuorela2012-02-021-4/+4
| | | | | | | | | | | QInputMethod better describes what the class is about, input methods in general, be they panels or just composing input from key events. Compatability headers added for old name. Not bulletproof but should be enough to get transition done. Change-Id: Iefde6e7ccb1ec4a3b226cef3469089e751c60fc1 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove input context action support from editorsPekka Vuorela2011-12-201-12/+0
| | | | | | | | Relying on obsolete QInputContext API. Change-Id: I954ccf57204cbb24ff5cec622384fa3b9932a079 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Adapt from QInputContext interface to QInputPanelPekka Vuorela2011-12-201-18/+14
| | | | | | Change-Id: I4143c3b516e7b0e46c706b8a6560bca9d8951572 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Move cursorDelegate with the mouse selection of read only text input.Andrew den Exter2011-12-121-2/+6
| | | | | | | | | Task-number: QTBUG-20719 Task-number: QTBUG-19109 Reviewed-by: Martin Jones Change-Id: I2cec51eb5b01dc5750614edf5b39d6a3da661fc6 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Make it easier to select words at the start of a line.Andrew den Exter2011-12-121-12/+22
| | | | | | | | | | | | | QTextControl's word selection will only include a word if the cursor position is past the mid point of the word. This can make it difficult to select words near the edges of the screen on touch devices. For the TextEdit word selection mode select a word ignore the relative position within a word. Task-number: QT-5206 Task-number: QTBUG-20719 Change-Id: I77e71e01d8021d66ada785cf894ba876faccefdf Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* QWidget text editors to commit text on their own on losing focusPekka Vuorela2011-11-101-0/+1
| | | | | Change-Id: I3b907661e8a24a6dbdaabf607c5c528b1b471c98 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QTextEdit to use tentative commit instead of QInputPanel::commit()Pekka Vuorela2011-11-101-5/+24
| | | | | | | Latter to be deprecated. Change-Id: I2c302c73a7ab2f4201af6a3c6fb4a64a4760263e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement partial tentativeCommit support in QTextEditPekka Vuorela2011-11-101-0/+18
| | | | | | | Available on plain text for now, html support still pending. Change-Id: I0818b97874e80c8c1b33a9127aa7bb3330a8761d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QTextEdit - mouse events to override input contextPekka Vuorela2011-11-051-99/+118
| | | | | | | | | | - Selection can start on top of preedit - Mouse press outside preedit commits - Double click to commit on top of preedit Change-Id: Ia2698d97d354a677d935de1a8fd9ed53a161ca5e Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Multiline editors not to limit anchor position inputMethodQueryPekka Vuorela2011-10-241-1/+1
| | | | | | | | | | | | The queries were limited to current block, because that is the available surrounding text. Input method side, however, cannot then distinguish between anchor being really at start or end of the surrounding text, or beyond it. Without the limitation there at least is a way to know anchor is at unknown territory. Change-Id: I388d33566388344ec816ea7d86662b7e36a3d7d0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Widgets: Remove Q_WS_QPA and qpa-sections from .pro files.Friedemann Kleint2011-10-211-5/+1
| | | | | | | | | | | | Enable compilation without -qpa. - Remove conditionals from Q_WS_QPA sections. - Rename precompiled header. - Remove gui-related Q_OS_SYMBIAN-#ifdef sections. - Leave other Q_WS code in for reference. Change-Id: I16326b631fff483aec8edd2f7a2e7a1822eab814 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QTextEdit - Fix selectionChange emission bugPekka Vuorela2011-10-111-6/+17
| | | | | | | | | | | | QTextEdit did not emit selectionChange signal if selection availability did not change, but the start or end of the selection did. This was causing unit test to fail. Change-Id: Iea0cb0bae767bc8d2dd36141362f9a084af97266 Reviewed-on: http://codereview.qt-project.org/6426 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Removed obsolete custom input context supportPekka Vuorela2011-10-111-11/+3
| | | | | | | | | | | Removed from QWidgetPrivate and QWidgetTextControl. Now using only application specific input context. Change-Id: Id25882e72026f58dab51a18e5d04a11225429963 Reviewed-on: http://codereview.qt-project.org/6427 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Get rid of the last traces of QMimeSourceLars Knoll2011-09-291-1/+0
| | | | | | | | | | | The class has been deprecated since Qt 4.0, but couldn't be removed as QDropEvent inherited from it. Change-Id: I9caa19b30977a319e79255900dee8b2425783f46 Reviewed-on: http://codereview.qt-project.org/5754 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Rename ImMicroFocus to ImCursorRectangleLars Knoll2011-09-081-1/+1
| | | | | | | | | Also set ImhMultiLine on QTextEdit Change-Id: I04a5a1d69c2048ea94c24210e2b8374f334be1b6 Reviewed-on: http://codereview.qt-project.org/4414 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Refactor QMouseEvent to contain the position inside the windowLars Knoll2011-09-011-1/+2
| | | | | | | | | | | | | | Rename the default accessors for positions to localPos, windowPos and screenPos, to be explicit about their use. Introduce a QT_NO_INTEGER_EVENT_COORDINATES define so one can make sure to always use the float based coordinates. Fixup all Qt code to use the correct constructor that specifies all three coordinates. Change-Id: If4bb93b8d1e2eb2440260d99680c468706cfe68f Reviewed-on: http://codereview.qt.nokia.com/4058 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Restore feature compatibility with QPrinter in QTextDocument::printLars Knoll2011-08-191-4/+2
| | | | | | | | | | | | Add a margin method to QPagedPaintDevice. The other variables required are stored in QPagedPaintDevicePrivate without a public API for now. This needs cleaning up once we have a new printing system. Change-Id: Id3f2d7ac7f3cbce8619072a897d91f3a588add64 Reviewed-on: http://codereview.qt.nokia.com/3211 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Don't rely on QPrinter in widgetsLars Knoll2011-08-191-5/+6
| | | | | | | | | | | Use the QPagedPaintDevice instead for the current print() methods. Like this we can move the whole printing system into it's own library. Change-Id: I5e23fb3a9304eb3d12aa54959893601566249e23 Reviewed-on: http://codereview.qt.nokia.com/3208 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Use the paged paintdevice in the print() method of QTextDocument.Lars Knoll2011-08-191-2/+0
| | | | | | | | | | This is required to be able to move the printing system into it's own library. Change-Id: If70a55be4c4413f9cd917a30d1b368f32c1145e4 Reviewed-on: http://codereview.qt.nokia.com/3207 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Renamed QLine/TextControl to QWidgetLine/TextControlLars Knoll2011-06-271-0/+3150
Renamed them to free up the QTextControl and QLineControl class names for a new API in QtGui. Reviewed-by: Jørgen Lind