aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktextfield.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-11-061-4/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickabstractbutton_p.h src/quicktemplates2/qquickbuttongroup_p.h src/quicktemplates2/qquickrangeslider.cpp src/quicktemplates2/qquickrangeslider_p.h src/quicktemplates2/qquickswipeview_p.h src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextarea_p.h src/quicktemplates2/qquicktextfield_p.h Change-Id: I7cba8783b1dd85a4db534222e36572ee05dd01d0
| * QQuickTextField: retain selection on right mouse button clickJ-P Nurmi2017-11-031-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | QQuickTextField wants to emit pressed(), released(), and pressAndHold() signals not only on left, but on all mouse button clicks. Therefore it explicitly sets accepted mouse buttons to all. However, the base class, QQuickTextInput, has only been prepared to handle left (selection) and middle (paste) mouse buttons. Don't pass right mouse button -only events to the base class to avoid it clearing selection on right click. Task-number: QTBUG-64048 Change-Id: I015820c78995cc8dd7cbeb16fca0f9b991040bad Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-09-111-1/+2
|\| | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquicklabel.cpp src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextfield.cpp Change-Id: Ibbf6bc48972f58fbc6779a87ac9e2434c56c4db8
| * Fix font inheritanceJ-P Nurmi2017-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | In item views, it can happen during incubation that a control doesn't yet have a window associated when the parent item changes. Therefore we must make sure to resolve the font when the window changes. Task-number: QTBUG-63119 Change-Id: I890f70ae6faa232dcc2c094ccec02e76b371d2cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make use of QQuickItem::ItemEnabledHasChangedJ-P Nurmi2017-08-311-8/+14
| | | | | | | | | | | | | | | | It was added in qtdeclarative commit 286f14f1. Getting rid of the slow QObject::connect() gives a little boost of 1~2 frames in qmlbench. Change-Id: If027fe2bee9eedad572afe8828b302c2f44cffac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix accessibility-related performance regressionsJ-P Nurmi2017-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 089dd16f, we had a QQuickControlPrivate::accessibleAttached member that indicated whether accessibility was active. Since 4be38ab in qtdeclarative, it was possible to access QQuickAccessibleAttached:: attachedProperties() directly, but we ended up accidentally accessing it even when accessibility was not active, which added noticeable overhead. This improves those qmlbench test cases that call accessibility-aware setters such as QQuickAbstractButton::setChecked() a lot. For example, the test cases for CheckBox and RadioButton create large amounts of controls with a "checked: index % 2" binding. - CheckBox: 84 => 93 frames - RadioButton: 98 => 113 frames QAccessible::setActive(true) only notifies the observers, but does not really make accessibility active in the sense that the consequent calls to QAccessible::isActive() still return false. tst_accessible had to be changed to use QPlatformAccessible::setActive() instead. Change-Id: I8fd0fe2dddfd5633ce22a080bcda459f2d6e443e Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Accessibility: cleanup and fix the attached property handlingJ-P Nurmi2017-05-311-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously qmlAttachedPropertiesObject() refused to create attached properties object instances for objects that were not created in QML. QQuickControl & friends created a "fallback" instance of the accessible attached properties object, which made tst_accessible pass, but since QQuickAccessibleAttached was not aware of the instance, accessibility did not work for these controls that created the instance by hand. In qtdeclarative commit 4be38ab, qmlAttachedPropertiesObject() has been changed to allow creating attached properties for objects instantiated in C++. This allows us to remove the non-functional fallback instance. Change-Id: I8a86388dc4dee4721284d47aefc15940a75e6c8d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: add the Qt version to "\since QtQuick.Controls 2.3"J-P Nurmi2017-05-311-1/+1
| | | | | | | | | | | | | | For the earlier versions, this was already done in the 5.9 branch. Change-Id: I3fd3840aca0f5aadd7aa77eba358ac0f6c94f942 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-301-4/+4
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickrangeslider.cpp Change-Id: I7eb990cfdc91173f86552841ba16536b35ea09cf
| * Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-301-4/+4
| | | | | | | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add support for propagating palettesJ-P Nurmi2017-05-261-0/+74
| | | | | | | | | | Change-Id: Icd965d8a79f022f4375e2134621cbc3897014015 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Cleanup and unify font handlingJ-P Nurmi2017-05-101-9/+22
|/ | | | | | | | | | | | | | | | | | | First of all, move the remaining user requested fonts to ExtraData. This was done for QQuickControl, but not for the controls that do not inherit QQuickControl: QQuickLabel, QQuickTextField & QQuickTextArea. The ExtraData starts really paying off later when introducing palettes that propagate similarly to fonts. Furthermore, give a more explicit name ('font' vs. 'requestedFont') for the user requested fonts. This lets us use 'font' (instead of just 'f') as an argument name in those various font-helper methods in the private classes. Furthermore, sync QQuickLabel|TextField|TextArea's font handling with QQuickControl. It would be best to share the code somehow, but it's quite tricky due to different base classes, font members ('resolvedFont' vs. 'sourceFont'), and notifier signals. Change-Id: I50cc1af160bb033ae604b4239e438c083d83f15d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-101-2/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextfield.cpp Change-Id: Ie80a2d3bcbb961a38e3dffa247547d3d860c231a
| * Editors: fix mouse cursorJ-P Nurmi2017-02-081-2/+4
| | | | | | | | | | | | | | | | Read-only editors should not use the IBeam cursor, but switch to a plain arrow cursor. Change-Id: If579571ceff086af6b8259ade769b5efb27565db Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Port from QT_NO_ACCESSIBILITY to QT_CONFIG(accessibility)J-P Nurmi2017-02-241-8/+8
| | | | | | | | | | Change-Id: I03deebff661746d49e537af5b1c8899b938efb0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Port from QT_NO_CURSOR to QT_CONFIG(cursor)J-P Nurmi2017-02-241-1/+1
| | | | | | | | | | Change-Id: If7dd96ed25b1183586b903503b160fdeaef1ccea Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Cancel incubation of replaced/destroyed delegatesJ-P Nurmi2017-02-101-16/+1
| | | | | | | | | | | | | | | | Resolves the "Object destroyed during incubation" issues. Task-number: QTBUG-50992 Change-Id: Ie58c958dafbf915da7494dac25351be98106c6ea Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add "hover support" configure featureJ-P Nurmi2017-02-061-1/+30
| | | | | | | | | | | | | | | | | | | | ./configure -no-feature-quicktemplates2-hover [...] Qt Quick Templates 2: Hover support .......................... no Change-Id: I0509a1a9ac3ffe2cbfe4f2016ce0345708860b84 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Cleanup QQuickTextFieldJ-P Nurmi2017-01-191-57/+48
| | | | | | | | | | | | | | | | | | | | Organize QQuickTextFieldPrivate methods first, in the same order as they are declared in the header, and then the QQuickTextField methods, instead of mixing them randomly. Also, remove an empty destructor, and apply some cosmetic coding style tweaks, remove unused includes... Change-Id: I36c57c20419cca3aaf77f955a464c5ee0e4e3374 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Re-format constructorsJ-P Nurmi2017-01-191-2/+2
|/ | | | | | | | | | | It was a bit inconsistent before. Admittedly the colon at the end was the most commonly used style in the quicktemplates2 code base, but some had a line-break before the colon. This is now chosen as the one true coding style of QQC2. ;) It makes the initializer list aligned so that it stands out from the constructor body. Change-Id: I66835e088df90d7219af04915176006d2a934ddc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickXxxPrivate::deleteDelegate(): don't store null pointersJ-P Nurmi2017-01-061-1/+1
| | | | | | | Avoid unnecessarily allocating extra data and/or pendingDeletions. Change-Id: I41d68af513c078a48bbe4f026bfe25e9c45ba3a8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/Drawer.qml src/imports/controls/Frame.qml src/imports/controls/GroupBox.qml src/imports/controls/Page.qml src/imports/controls/Pane.qml src/imports/controls/ToolBar.qml src/imports/controls/Tumbler.qml src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickpopup.cpp tests/auto/accessibility/data/busyindicator.qml tests/auto/accessibility/data/button.qml tests/auto/accessibility/data/checkbox.qml tests/auto/accessibility/data/control.qml tests/auto/accessibility/data/dial.qml tests/auto/accessibility/data/label.qml tests/auto/accessibility/data/menu.qml tests/auto/accessibility/data/pageindicator.qml tests/auto/accessibility/data/popup.qml tests/auto/accessibility/data/progressbar.qml tests/auto/accessibility/data/radiobutton.qml tests/auto/accessibility/data/rangeslider.qml tests/auto/accessibility/data/scrollbar.qml tests/auto/accessibility/data/scrollindicator.qml tests/auto/accessibility/data/slider.qml tests/auto/accessibility/data/spinbox.qml tests/auto/accessibility/data/switch.qml tests/auto/accessibility/data/tabbar.qml tests/auto/accessibility/data/tabbutton.qml tests/auto/accessibility/data/textarea.qml tests/auto/accessibility/data/textfield.qml tests/auto/accessibility/data/toolbar.qml tests/auto/accessibility/data/toolbutton.qml tests/auto/accessibility/tst_accessibility.cpp Change-Id: Ibc3f592162e97bef9147b35da8c9a79e73a907e6
| * Doc: revise brief descriptionsJ-P Nurmi2016-11-021-1/+1
| | | | | | | | | | | | Change-Id: If7bdd4c11aaeb2df87622c769b1a65ac82ac7e73 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-18/+2
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * Share Control::focusReason notes with TextArea and TextFieldMitch Curtis2016-10-131-15/+1
| | | | | | | | | | | | Change-Id: Icf4feb1e29c40f10f483be63581f178fdc1cbd12 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Share Control::background notes with TextArea and TextFieldMitch Curtis2016-10-131-3/+1
| | | | | | | | | | | | Change-Id: I4150dbbc272d63cd842e19a30138c9b734d260ee Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Make hoverEnabled propagate to childrenJ-P Nurmi2016-10-171-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hover effects can be sometimes a bit disturbing. This change makes it possible to conveniently disable hover effects for a tree of controls in one go. For example, to disable hover effects for a page including its header, footer, and all list items: Page { hoverEnabled: false header: ... footer: ... ListView { delegate: ... } } [ChangeLog][Controls][Important Behavior Changes] Control::hoverEnabled has been made to inherit to children, to make it possible to disable hover effects for a tree of controls in one place. Change-Id: Ia87144f2cc04957a32f89d3313816b91d97db635 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-141-1/+16
|\| | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p_p.h Change-Id: Ie7b4a114ad27a4cad337c91e8ebcf696b0e845d7
| * Delete replaced delegates after Component.completed() is emittedMitch Curtis2016-09-121-1/+16
| | | | | | | | | | | | | | | | | | This avoids the issue "Object destroyed during incubation" error. A proper fix is still required in the QML engine. Change-Id: I3c168cfe2d8c295662bcb5886e99a0f95748e302 Task-number: QTBUG-50992 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-171-0/+3
|\| | | | | | | Change-Id: I8172f493c5747db2c9e728b026ff267bff2e3427
| * TextArea & TextField: set IBeamCursorJ-P Nurmi2016-08-111-0/+3
| | | | | | | | | | Change-Id: Iba3f5c0847a57420e9a8f85c589496c4e698a01e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-151-0/+10
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickswipedelegate.cpp tests/auto/controls/data/tst_swipedelegate.qml tests/auto/controls/data/tst_textarea.qml tests/auto/controls/data/tst_textfield.qml Change-Id: I244f4ead4d14238c41db0bd965d7a2938f2ea8fc
| * QQuickTextArea & -Field: fix double-click to select a wordJ-P Nurmi2016-07-111-0/+10
| | | | | | | | | | | | | | | | | | The delayed/intercepted mouse press event must be passed first, before letting the base class handle the double-click event. Change-Id: I029d06b0b619f34bb7be13ae12b8904f2efe6b5b Task-number: QTBUG-54615 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Be consistent with naming of event argument in pressAndHold() signalsMitch Curtis2016-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | These were supposed to both be called "event". [ChangeLog][TextField] Aligned the name of the pressAndHold() argument with TextArea Change-Id: Icc55584df37e4de9a9f06af7968bd608e5045c05 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add pressed() and released() signals to TextField and TextAreaMitch Curtis2016-07-061-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | Users need these to e.g. open context menus when editors are right-clicked. [ChangeLog][TextArea][TextField] Added pressed() and released() signals. Change-Id: I32b79a8de0120a4f9115fa1c3cb832aff0134a15 Task-number: QTBUG-51009 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add hover support to TextArea & TextFieldJ-P Nurmi2016-06-291-1/+67
|/ | | | | | Task-number: QTBUG-50003 Change-Id: Ie101ba8840fba2a7503da8de77d9cf2a3c91d562 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix accessibilityJ-P Nurmi2016-05-031-0/+10
| | | | | | | | | Add missing componentComplete() -> accessibilityActiveChanged(true) calls to QQuickTextField, QQuickTextArea, and QQuickPopup. Task-number: QTBUG-53157 Change-Id: I0e79d7f1412c24f4d129c58ba1e7edf20b8d8ecf Reviewed-by: Liang Qi <liang.qi@qt.io>
* Avoid "implicitWidth/Height redefined" warningsMitch Curtis2016-04-291-2/+2
| | | | | | | | | In the same way that QQuickImplicitSizeItem does. Task-number: QTBUG-49371 Change-Id: I1a8315c41e49139a9375f66a5714493331d22318 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-2/+0
| | | | | Change-Id: I5b0015476c3ceef8f82b00d99b084b1ce3bfaa6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: rename Qt.labs.controls 1.0 to QtQuick.Controls 2.0J-P Nurmi2016-04-211-5/+5
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Templates: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. Change-Id: I39ef9cbb00f55a32b7a43f11ffbdfbb40b84e124 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Doc: add 2-suffix to the image assets and snippetsJ-P Nurmi2016-04-131-3/+3
| | | | | Change-Id: Ib8050cb3baefe07d28c7e2dcec64af155d2d7c9b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-0/+450
Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>