summaryrefslogtreecommitdiff
path: root/src/controls/TextArea.qml
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Fix Controls 1 types linking to Controls 2"Topi Reinio2016-06-221-1/+0
| | | | | | | | | | | This reverts commit b5a8306bf6d4949066872ac2afc8d0a01f716bd7. The incorrect \inherits commands caused property documentation from base types go missing. Task-number: QTBUG-54150 Change-Id: I0bbe604a6fe904d8e6a4596777262255a794ec62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix Controls 1 types linking to Controls 2v5.7.0-rc1v5.7.05.7.0Mitch Curtis2016-05-261-0/+1
| | | | | | Task-number: QTBUG-53529 Change-Id: I4933a03c49dee4e3edc56dd406f67073da341ac1 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* TextArea: disable selectByMouse on iOSRichard Moe Gustavsen2016-04-261-1/+1
| | | | | | | | | Until we have a better API in place for checking if a platform should select text with mouse or not, just disable it for now on iOS. Change-Id: Iabe64554dd1d8bb1deb6f232ef59e07ef1398b3f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Unify license header usageAntti Kokko2016-02-041-12/+15
| | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I3c851bc24da89f6300b94199387d1adf16ca4f48 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-291-1/+0
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I8a32df546611d7a8105ad31ed72f54dbac0b1250
| * TextEdit: don't clear selection from EditMenuRichard Moe Gustavsen2015-06-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code as it stood ensured that only one input field had a text selection at a time. This is not correct, several text edit fields are allowed to have a selection simultaneously. The code that cleared the selection was found in the updateSelectionItem code. iOS is the only platform using the selectionItem. But looking closer at how selections work on iOS, we don't really need to track the selectionItem after all. It's fine that you need to gain focus on a line edit / text edit before you open the edit menu. Moreover, we also lacked the possibility to open the selection menu when just clicking on a focused line edit. So this patch will therefore just remove all the code that had todo with the selectionItem, and adjust a bit how selections work on iOS. Task-number: QTBUG-41375 Change-Id: I0f3951cb7f53e5adae8d8753a7058ee316825921 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-191-12/+19
|\ \ | |/ | | | | | | | | | | Conflicts: src/controls/TextArea.qml Change-Id: I1edc6fa3b51e58d9aa290c9d099cac2e85ea176c
| * Fix text selection handles to float on topJ-P Nurmi2015-04-161-12/+19
| | | | | | | | | | | | Task-number: QTBUG-42538 Change-Id: Ia6d38819c994dcd9713958faf0c17de2023c9f25 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-03-171-13/+13
|\ \ | |/ | | | | Change-Id: Ic5cc4de64e4365cfbc5587c28e140d39cdda8a93
| * Doc: Fix qml method signaturesCaroline Chao2015-03-131-13/+13
| | | | | | | | | | | | | | | | | | | | So the return value and parameters can be seen in the documentation. + Fix minor doc issues Change-Id: I99e520c103bb0faeb88b26eb7b9ff73922851abc Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devJ-P Nurmi2015-03-111-1/+1
|\ \ | |/ | | | | Change-Id: If515f72dd9651b482cda7afd76895aefa745fa57
| * Doc: Fix qtdoc warningsCaroline Chao2015-03-061-1/+1
| | | | | | | | | | | | | | | | | | Mostly link errors and missing documentation. And removed useless references to {QtQuick.Controls.Styles} in the doc. Change-Id: Iad211a574c0bd23c84e067e0cbcc18c3e719cde7 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devFrederik Gladhorn2015-03-061-1/+1
|\ \ | |/
| * Merge Extras' styling system into Controls'.Mitch Curtis2015-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removes the duplicated style settings functionality in Extras and simplifies the installed styles directory structure. - Extras' Base style is now part of Controls' Base style, eliminating the need for a separate QtQuick.Extras.Styles import. The cost of doing this should be negligible: a few QML files and two images. If we didn't merge Extras' Baste style into Controls', we'd need extras-specific code in qquickcontrolssettings, as the default style search path is: qml/QtQuick/Controls/Styles/ Whereas the Extras Base style would be in: qml/QtQuick/Extras/Styles/ The Extras Base style can't go into Controls' Base style directory, either, because otherwise we'd have two qmldir files there. The Flat style doesn't have this problem because it is all contained in one plugin and gets installed into its own Flat/ folder. - Documentation now lists the Extras controls as \since QtQuick.Extras 1.4. - Adds the customcontrolsstyle auto test to ensure that custom styling is tested. Change-Id: I19ca7a8b7e1c1daa85b272f4ccf9a2f05c76e0d9 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | TextArea: add editingFinished signalLiang Qi2015-03-031-1/+12
|/ | | | | | | | | | Autotest is included. [ChangeLog][TextArea] add editingFinished signal Task-number: QTBUG-44734 Change-Id: I9d717e6d87c4e45bf2ab447c0a6958b055f993ff Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Controls: update license headersJ-P Nurmi2015-02-111-28/+24
| | | | | | | Change-Id: I77e7a218a958d76ac7ef7780f4be52a81f76fa6b Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into 5.4.0" into ↵Jani Heikkinen2014-11-111-1/+1
|\ | | | | | | refs/staging/5.4.0
| * Let the cursor handle be visible regardless of selectionJ-P Nurmi2014-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | The cursor handle is visible on Android even when there's no selection. Let the style decide when to show/hide the handles, but make sure to disable the corresponding MouseArea when a handle is hidden. Change-Id: I211c122998223ad25279bee2841c5b5e14d4c48e Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | Fix text selection on desktopJ-P Nurmi2014-11-111-3/+3
|/ | | | | | | | | | | | | | So far, text selection handles were only provided by mobile specific styles. The new Flat style is an exception that provides text selection handles for mobile, but is still intended to be usable on desktop too. The text selection handling code thus needs not only to check whether the text selection handles exist, but also whether it's a mobile platform. This fixes text selection on desktop. Change-Id: Ibda2045ca42970e7db692d2e8370ac0dba21625a Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* TextArea: Make selection persistentGabriel de Dietrich2014-10-311-0/+1
| | | | | | | | Losing focus is no reason to lose the user's input. This is how desktop platforms work. Most mobile platforms work the same way. Change-Id: Ifea1051cd79ea9d0213adfd4f02c18b5573e7823 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Make the cursor and selection handle delegates private for nowJ-P Nurmi2014-10-301-3/+3
| | | | | | | | | | | | | | | | | | The API is not ideal, we don't want to lock this thing down like as it is now. All styles implemented so far created CursorHandleStyle.qml and SelectionHandleStyle.qml so perhaps that's the better way to go. Furthermore, there's never going to be multiple occurrences of the handle pairs, so it should be one shared instance. Thus, the relevant style delegates probably shouldn't be sprinkled around various control styles... So, for now, the most pragmatic solution is to make the handles and cursors internal since we don't have time to revamp it before 5.4.0. Change-Id: Ib9fcc4a431bb510c8c55a760159f4d6a631554b3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* text input: fix disabling of action logic when there is a menu assignedJ-P Nurmi2014-10-291-2/+2
| | | | | | | | The "menu.source" check added by 38b908a is always true even for an empty url => use "menu.item" instead. Change-Id: Ic9004dff18c848a720ea1c414b2921158a367778 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* TextInput: disable activation logic when there is a menu assignedRichard Moe Gustavsen2014-10-271-0/+4
| | | | | | | | | The edit menu has it's own logic for when to show the menu, when to activate the input field etc upon press/release/click. So if there is a menu, don't interfere with its logic. Change-Id: If6af1e7b8f6bc68c66836846969cfe6bcee56de4 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix TextField & TextArea mouse cursor shapeJ-P Nurmi2014-10-171-1/+3
| | | | | | | | | | Mouse cursor shape is specified by an internal MouseArea inside editor. Edit menu was placing another MouseArea on top, so the cursor shape was lost. This change makes EditMenu re-use the same MouseArea. Task-number: QTBUG-41955 Change-Id: I71e38bb42ea20f63b3e15c4c2cc7282b64b10d62 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* TextArea: ensure selection handles are visible when inside the flickableRichard Moe Gustavsen2014-10-171-4/+14
| | | | | | | | | | | | | | The current implementation would hide the handles when parented into the flickable and the content view was flicked up. The handles would in those cases have an y pos greater than the viewport height. But since contentY would be greater as well, the handles should still be visible. This patch will ensure that the visible logic takes the handle parent into account when calculating if it overlaps the viewport. Change-Id: I591a4eb8a71b89720c80b190113888b5601fd060 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* add support for setting cursor delegate through styleRichard Moe Gustavsen2014-10-061-0/+1
| | | | | Change-Id: I064c4df7213a8c1c0ecc38ea9b224444abf13d1d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* EditMenu: let menu property be a component to lazy load itRichard Moe Gustavsen2014-09-241-3/+4
| | | | | | | | | Since all input fields have a menu assigned to it by default (which in most cases never will be shown), it should be an optimization to await creating it until needed. Change-Id: I5777bbdae42103981e9b2f5ddfdfd763acea07ae Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Add EditMenu to input controlsRichard Moe Gustavsen2014-09-231-0/+20
| | | | | | | | Add EditMenu to TextArea, TextField, ComboBox and SpinBox. Change-Id: Ic2fed55c467dde65334006d252f4052430f3f40c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4J-P Nurmi2014-09-181-1/+1
|\ | | | | | | | | | | | | Conflicts: src/controls/qquickmenupopupwindow.cpp Change-Id: Ibc10e7da3b3a2983c022b8973cd80cb1a7e110af
| * Revert "TextField/Area: soft dependency to inputMethodHints"J-P Nurmi2014-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This broke the input method hints handling altogether. We will fix this properly in QtQuickTextInput and QQuickTextEdit instead. Nobody has even complained about QT_NO_IM, it was a hypothetical problem brought up in code reviews. This reverts commit c185d6cd67653b34f04a7999a84634de1f1063b0. Change-Id: Ib81adba1ee899dd2a384bd83eea82d629eacb333 Reviewed-by: Samuel Nevala <samuel.nevala@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | TextSingleton: implement API for getting current item with selectionRichard Moe Gustavsen2014-09-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | On some platforms (iOS) you can select text without giving focus to the input. To be able to clear selection from other parts of the code (iOS will only let one input have selection at a time), we need to track this. Later patches will make use of it. Change-Id: I4689253b439e0a86349e53c2edf2554fc96225f8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | TextSelection: improve logic that sync handles with selectionRichard Moe Gustavsen2014-09-111-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since property 'selectionPosition' is updated by QML after 'onSelectionStartChanged', we cannot depend on it directly from within the handler. Moreover, since selectionStart gets updated before cursorPosition, we need to update both selectionHandle and cursorHandle when either change to ensure that we use the latest values in both cases. This will fix two bugs that causes the handles to jump to wrong positions (and even wrong lines) once the user starts dragging. Change-Id: I74919abb4169439659bd42952d5d5e6020f33853 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | TextArea: don't reparent handles out of editor on iOSRichard Moe Gustavsen2014-09-081-2/+2
| | | | | | | | | | Change-Id: I3e3c43e7735c7ea1654475c132be9e8a4baa67fc Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | TextHandle: let handles only be visible when there is a selectionRichard Moe Gustavsen2014-09-081-3/+2
| | | | | | | | | | | | | | Remove the logic that a handle can be visible when there is no selection. Change-Id: I5269d0e69e08e3e801d5dcc226a9b011e3b255b7 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | TextHandle: take parent into account when positioning the handlesRichard Moe Gustavsen2014-09-081-4/+14
| | | | | | | | | | | | | | | | | | The set the position of the handle parent agnostic (and take into account margins etc), we need to use mapFromItem to get the correct position. Change-Id: Iba56ecc0634b24b92f56923b9404ea9c9ab9a2d1 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Text handles: fix input method commitsJ-P Nurmi2014-07-251-2/+0
| | | | | | | | | | Change-Id: I1fa2240915b114c6b46360233fcea2b6cee86cd7 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | TextArea: let style specify the default text marginJ-P Nurmi2014-07-241-1/+1
| | | | | | | | | | | | | | | | | | The hard coded 4px margin is unsuitable especially on High DPI devices. For example on Nexus 5 it should be 36px, so let the Android style specify a suitable value. Change-Id: I31287d2e78ae822b8bd63ea19674c85b08975426 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-07-091-2/+8
|\ \ | |/ | | | | | | | | | | Conflicts: src/controls/ToolBar.qml Change-Id: I5510496219a4ebe8bfced4192307219238ca9bb6
| * TextField/Area: soft dependency to inputMethodHintsJ-P Nurmi2014-07-021-1/+1
| | | | | | | | | | | | | | | | Don't use an alias to a property that might not exist (when QT_NO_IM), but just bind to it and fallback to Qt.ImhNone if it's undefined. Change-Id: I0e8de86acb534dfe620b829c2bff09db119ef08d Reviewed-by: Liang Qi <liang.qi@digia.com>
| * Doc: Added images and missing snippetsVenu2014-06-271-1/+7
| | | | | | | | | | | | Task-number: QTBUG-33799 Change-Id: I582518a73276d47cf63cf31411b5176a90acab6f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | TextField/AreaStyle: add styleData.activated() signal for handlesJ-P Nurmi2014-07-011-0/+2
| | | | | | | | | | | | | | | | | | This makes it possible for the Android style to implement "transient" handles that fade out when idle, and show up when the editor is clicked Change-Id: I53da6a4d5345c98b8b7286b30006982eaf17df45 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Add TextField/Area::inputMethodComposingJ-P Nurmi2014-07-011-0/+12
| | | | | | | | | | | | | | | | | | In order for the Android style to be able to control the visibility of the text cursor handle as appropriate, it needs to know when the input method is composing ie. when the user is typing. Change-Id: If8e3ac66b63c938659a5d9044d75eafd348cd6a3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | TextArea: fix the handles to honor selectByMouseJ-P Nurmi2014-06-301-3/+5
| | | | | | | | | | Change-Id: I1defac48449169bedea82c94d5badacb3d00d88e Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | TextField & TextArea: add support for selection handlesJ-P Nurmi2014-06-161-13/+120
| | | | | | | | | | | | | | Task-number: QTBUG-38934 Change-Id: Id581a6e56d3461b0df476c2b35c3e642fd505fc9 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-06-041-6/+1
|\ \ | |/ | | | | Change-Id: Ife57f59094cb9be9c5e8a187df8d1fd25110a53a
| * Fix TextArea's fontJ-P Nurmi2014-06-041-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | Using a Binding element overrides TextArea::font with a value from TextAreaStyle::font, whereas the style is only supposed to provide the default value. Use TextSingleton's font to avoid the original binding loop. Task-number: QTBUG-39328 Change-Id: I90113ef03dd31b2a060dfe12361708f99b35eb53 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-05-221-1/+6
|\ \ | |/ | | | | Change-Id: I1537496e887855f3f092189b7304d6614ed5ae5a
| * Fixed QML binding loop warning.Jason Erb2014-05-151-1/+6
| | | | | | | | | | Change-Id: I1339949afa6aeb659baf7186cbcb7a714d9826a3 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Expose cursorRectangle for TextField & TextAreaJ-P Nurmi2014-05-151-0/+8
| | | | | | | | | | | | Change-Id: I15ebfcb96e092c7deda647509ddd2aa67303b53d Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
* | Add missing TextArea::contentWidth and contentHeightJ-P Nurmi2014-04-151-0/+14
|/ | | | | | Task-number: QTBUG-38324 Change-Id: I6cd5cab164288434e589d2b5e8c5cbfbb9bbea90 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>