summaryrefslogtreecommitdiff
path: root/src/controls/ComboBox.qml
Commit message (Collapse)AuthorAgeFilesLines
* Make the cursor and selection handle delegates private for nowJ-P Nurmi2014-10-301-2/+2
| | | | | | | | | | | | | | | | | | 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>
* Doc: Fix code snippet in ComboBox documentationTopi Reinio2014-10-021-2/+2
| | | | | | | | Remove undefined id to make the snippet work. Task-number: QTBUG-41721 Change-Id: Ia5ba6629ac7e51305fa75261c4a79b06ac43bf2c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* qquickmenu: add support for providing a target rect to __popup()Richard Moe Gustavsen2014-09-301-2/+2
| | | | | | | | | | | | | | | | | Using a target rect as menu location instead of a position has been supported in QPlatformMenu for a while. The reason for specifying a rect instead of a position is that then the OS can decide if the popup should be placed above or below the target rect so that it fits inside the screen. A typical example is when showing an edit menu around a text selection. If the selection (target rectangle) is far up on the screen, the popup (with arrow) will be placed below the selection instead of above, which is the normal. Change-Id: Ie6cd6a92f1d9ef480c1e455960021c7f18f86569 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* EditMenu: let menu property be a component to lazy load itRichard Moe Gustavsen2014-09-241-3/+2
| | | | | | | | | 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/+12
| | | | | | | | Add EditMenu to TextArea, TextField, ComboBox and SpinBox. Change-Id: Ic2fed55c467dde65334006d252f4052430f3f40c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* ComboBox: support toggle combobox menu visibilityRichard Moe Gustavsen2014-09-221-12/+15
| | | | | Change-Id: If08cac41eef8dafcb45ce46c7cee7d499aa19c18 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* ComboBox: respect style padding for the editorJ-P Nurmi2014-07-281-2/+4
| | | | | | | | | | | | | | Get rid of the hard coded 8px left margin and use whatever value the style supplies (and is already used for the label). This allows the Android style to provide a sensible value for High DPI screens. The new value for the left margin is 6px in Base and Desktop styles. It looks slightly better, but still not pixel perfect. Notice that the text label of editable and non-editable ComboBoxes are not perfectly aligned in native Windows and OS X ComboBoxes either. Change-Id: I9a66c3a26fcd9ef1653b355e831277a7b6cbe72f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* ComboBox: add support for selection handlesJ-P Nurmi2014-07-181-11/+17
| | | | | | Task-number: QTBUG-38934 Change-Id: I0d7bfc821ff345e76d1ae89818f6a5e0120695f5 Reviewed-by: Liang Qi <liang.qi@digia.com>
* Add ComboBox::inputMethodComposingJ-P Nurmi2014-07-181-0/+12
| | | | | Change-Id: I3701a28721252bc3cca46a223bb665faf38002f7 Reviewed-by: Liang Qi <liang.qi@digia.com>
* ComboBox: query font & colors via style panelJ-P Nurmi2014-07-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advanced custom styles have difficulties binding values from native styling elements to the style root, because such styling elements are created inside delegate components. ComboBoxStyle { id: style panel: Item { NativeStyle { id: native elementType: "ComboBox" } // typical "backwards" bindings that we want to avoid: Binding { target: style; property: "font"; value: native.font } Binding { target: style; property: "foo"; value: native.foo } Binding { target: style; property: "bar"; value: native.bar } // ... } } Becomes: ComboBoxStyle { id: style panel: Item { NativeStyle { id: native elementType: "ComboBox" } font: native.font foo: native.foo bar: native.bar // ... } } Change-Id: I23a3a6528cf0162dc91f94a44bcade2985260a9d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* ComboBoxStyle: allow specifying text & selection colorsJ-P Nurmi2014-07-121-3/+3
| | | | | | | The system palette colors are not suitable for all styles. Change-Id: I326e57a3bac9c11dab9a40d1e4c933fc534e7ada Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-07-091-2/+13
|\ | | | | | | | | | | | | Conflicts: src/controls/ToolBar.qml Change-Id: I5510496219a4ebe8bfced4192307219238ca9bb6
| * Fix editable ComboBox mouse cursorJ-P Nurmi2014-07-091-1/+9
| | | | | | | | | | Change-Id: I6866686b09348f486c6629917d271b640b1b734e Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
| * Doc: Added images and missing snippetsVenu2014-06-271-1/+4
| | | | | | | | | | | | Task-number: QTBUG-33799 Change-Id: I582518a73276d47cf63cf31411b5176a90acab6f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Add ComboBoxStyle::fontJ-P Nurmi2014-07-091-1/+1
| | | | | | | | | | | | | | | | | | Replace the hidden editorFont-property (recently added for the Android style) with a proper font-property that is used in other styles too. The same font is used for the label and the editor. Change-Id: I3fd1aa1d501ada335046c0d0401119e2e0a22c11 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-06-251-5/+16
|\ \ | |/ | | | | | | | | | | | | Conflicts: .qmake.conf src/controls/Styles/Desktop/SpinBoxStyle.qml Change-Id: Ia501c1388a2af9f273ec2742abbfc766717ad9e6
| * ComboBox: open the popup on release on touch devicesJ-P Nurmi2014-06-231-2/+13
| | | | | | | | | | | | | | | | | | This is the common behavior on touch devices, and avoids such problems as opening the popup while trying to flick a ScrollView that contains a ComboBox. Change-Id: I9207bc2c00524fe4cd5a673f4fe505f6db825838 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
| * Singleton SystemPaletteJ-P Nurmi2014-06-231-3/+3
| | | | | | | | | | | | | | | | | | | | Each SystemPalette instance installs an event filter on the application object. Avoid this by sharing a single SystemPalette instance. Change-Id: Ica9f8979b33e511c1238add3d689f380d0daa93c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-05-141-1/+3
|\ \ | |/ | | | | | | | | | | | | Conflicts: .qmake.conf src/controls/Private/TabBar.qml Change-Id: Id176e44fe8e402c1c2c021ecb63c8c5c75736d47
| * ComboBox: Subtract style padding from TextInput widthGabriel de Dietrich2014-04-291-1/+1
| | | | | | | | | | | | | | | | Task-number: QTBUG-38384 Change-Id: I89b59bda26188e9aebdd696d0a3af02389921279 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
| * ComboBox: Update currentText when currentIndex goes from -1 to 0Gabriel de Dietrich2014-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | We need to help things a bit because the internal selectedText property won't change in that specific case. Task-number: QTBUG-38036 Change-Id: Id997da97a77faad8ffaad08e8b9c7614d8b6b7fc Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | ComboBox: let style specify a font for the editorJ-P Nurmi2014-05-051-0/+1
|/ | | | | Change-Id: I6a65309d35ad3d50116a69b85ad88093399b0457 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Bump QtQuick.Controls import version to 1.2J-P Nurmi2014-04-071-2/+2
| | | | | Change-Id: Idc0b93cbfc2fe23e8be3bcaece672d06555a81f6 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Import QtQuick 2.2J-P Nurmi2014-04-071-2/+2
| | | | | Change-Id: Ifc9719ec6fbbd80b866c01eebc471d0ed121bd16 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Doc: Append handler names to \qmlsignal documentationSze Howe Koh2014-03-181-0/+4
| | | | | Change-Id: I5e06bdf03ba1ba8e5fe7669f690420dc9a039129 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-121-2/+2
|\ | | | | | | | | | | | | Conflicts: src/layouts/qquicklinearlayout.cpp Change-Id: Ib24dab43c37fc0f3f6a85398766f102a1ac833c3
| * Doc: Fix broken linksSze Howe Koh2014-02-061-2/+2
| | | | | | | | | | Change-Id: Ibf4431b20b61c5e16c6936775647ba3eb0049abe Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Accessibility improvementsFrederik Gladhorn2014-02-071-0/+2
| | | | | | | | | | | | | | | | [ChangeLog][QtQuickControls] Accessibility improved: ComboBox is labeled properly, check and radio boxes report their state correctly Change-Id: Ia9fe88f032a627c839bd3ef3aec4e2e6cb4517a7 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-271-0/+1
|\ \ | |/ | | | | Change-Id: I974d73fda7e0eb4ea99b354a054452f057327644
| * Controls: Fixed support for Keys attached property on controls allowing text ↵Liang Qi2014-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | input By forwarding key events from the internal control. It includes TextField, TextArea, ComboBox, SpinBox. The key events from internal are Keys.forwardTo controls, then user could customize their own behavior for those controls. Autotest are included. [ChangeLog][QtQuickControls] Fixed support for Keys attached property on controls allowing text input, by forwarding key events from the internal control. Task-number: QTBUG-33493 Task-number: QTBUG-34101 Task-number: QTBUG-35763 Change-Id: I00ea131160e55048b34fe0713e1ee02ff9472f05 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-171-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/controls/Styles/Base/ComboBoxStyle.qml src/controls/Styles/Desktop/ComboBoxStyle.qml src/layouts/qgridlayoutengine.cpp Change-Id: I14298b9b3521fe220248e4b27e7057d538af5c49
| * Fix typo in property in ComboBoxStyleDavid Edmundson2014-01-161-1/+1
| | | | | | | | | | | | | | | | | | drowDownButtonWidth seems to be a typo in an exposed property name. In order to keep compatibility an (undocumented) alias is added. Change-Id: I2ab04b3518325e339c31cf6f403c488256a4aabe Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-101-4/+23
|\ \ | |/ | | | | Change-Id: I2491c91285196583e784033e78757743bfa2a423
| * ComboBox: Allow setting currentIndex to -1 to clear selectionv5.2.1Gabriel de Dietrich2014-01-081-3/+22
| | | | | | | | | | | | | | | | Task-number: QTBUG-35794 [ChangeLog][QtQuickControls]ComboBox: Allow setting currentIndex to -1 to clear selection Change-Id: I034b061484ab095a9ec049fb3b35614b98bfb956 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
| * ComboBox: Don't suggest auto-complete text if editText is emptyGabriel de Dietrich2014-01-081-1/+1
| | | | | | | | | | | | | | ... for editable ComboBoxes, that is. Change-Id: Ieda089f715e8252ae47bbbff647982f96ec5f797 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-6/+7
|\ \ | |/ | | | | Change-Id: I1a5f92b0677644b52b86605616938e6dff9a8f65
| * Make editable Combobox accept substringsJens Bache-Wiig2013-12-131-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the issue that onAccepted would not update the currentText or current index if the string was a substring/partial match. Note that the new internal MatchFixedString case matches the complete string in a case insensitive way. [ChangeLog][Qt Quick Controls][Editable Combobox would not update currentText when accepting a substring of an existing value.] Task-number: QTBUG-35521 Change-Id: Ied850208425ae71b2414f1abf9389e9a8ed50cfb Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-051-19/+31
|\ \ | |/ | | | | Change-Id: I04b45f6e998fdeff87d237ec49a74f7c53b1d9f2
| * Make scrolling on combobox workMartin Klapetek2013-12-041-19/+31
| | | | | | | | | | | | | | | | | | Handles mouse scrolling event over combobox - scrolling up does the same as pressing up arrow and scrolling down equals pressing down arrow. Change-Id: I67adef46f201c0d4c88dabd5a717effc8f1e909d Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-291-7/+8
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I626baf91e8bb9e9816346fdb842c0d577ca23d77
| * Fix disabled text color of an editable ComboBoxJ-P Nurmi2013-11-271-4/+3
| | | | | | | | | | Change-Id: I2b38fa17434796be65a88d7c8d14ff94a7e2b233 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
| * ComboBox: Call resolveTextValue() after any model changeGabriel de Dietrich2013-11-261-3/+5
| | | | | | | | | | | | | | | | Particularly if the nature of the model has changed (e.g., from null to array). Task-number: QTBUG-34936 Change-Id: If07690a8836dcd786ed7a32afda1e344d048d31f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Add ComboBoxStyle::renderTypeJ-P Nurmi2013-11-271-1/+1
|/ | | | | Change-Id: I59c145d0826926b096faae7b01390e9201b5e28f Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* More styling improvements for Base StyleJens Bache-Wiig2013-10-311-1/+2
| | | | | | | | | | - Better scalability - Retina support - Added glow filter to Private - Added focus rects Change-Id: I2ec36a9db546c21e20408429c5e17fde8d67b7c3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* ComboBox: Minimize currentText changes when changing modelGabriel de Dietrich2013-10-251-5/+41
| | | | | | | | | | | | | | | | Bonus change, changing the model after its initial value will reset currentIndex to 0. test_arraymodelwithtextrole needs some rework. The issue relies on textRole and model being set separately, and a late change to __modelIsArray updating the currentText when it probably shouldn't. [ChangeLog][QtQuick Controls][ComboBox] Changing the model after initialization will reset currentIndex to 0 Change-Id: If6c0dee9e022036ef888f2aef87a5c405868684b Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Doc: Fix links to Qt Quick Controls Styles itemsCaroline Chao2013-10-231-1/+1
| | | | | Change-Id: I406c159fbc573e8b0a999d85fd6fb546b71634ac Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix warning in ComboBox when model is emptyJens Bache-Wiig2013-10-221-1/+1
| | | | | | | | We cannot assign null to a QString property. Change-Id: I659a7edcefe586e37330ee56ec52756585c147e1 Task-number: QTBUG-34164 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Doc: Changed the \since argument to the Qt version.Jerome Pasion2013-09-261-1/+1
| | | | | | | | | | | | | | -1.0 types were introduced in Qt 5.1 -1.1 types were introduced in Qt 5.2 -The module versions are now taken from the \qmlmodule This change was only applied to \qmltype. For methods, signals, and properties, we keep the \since QtQuick.Controls <version> Task-number: QTBUG-32172 Change-Id: Iefa73d4a489aa285bae873f68ae9a228030f0115 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* ComboBox: Editable CBs and popups don't go well togetherGabriel de Dietrich2013-09-191-1/+1
| | | | | Change-Id: I387521908df378d0e4f75b546999ff37b6cdae13 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Make ComboBox editableJens Bache-Wiig2013-09-171-6/+290
| | | | | | | | | | | | | | | | | | In addition - Added text completion - Added validator - Added accepted signal - Added activated signal - Added textAt function - Added find function - Added keyboard indexing for non-editable as well Note that we do not support adding values to the model, but leave this up to the user to handle in onAccepted. Change-Id: I1d76fa83aea0e488959c418d22ce7b6027675d86 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>