summaryrefslogtreecommitdiff
path: root/src/controls/ComboBox.qml
Commit message (Collapse)AuthorAgeFilesLines
* ComboBox: guarantee index consistency when emitting activated()Alberto Mardegan2018-02-121-2/+6
| | | | | | | | | | | | | | | | | | The "triggered" signal from the ComboBox menu items is handled twice: once in ComboBox.qml, and once in QQuickMenuItem. The function of the latter is to update the parent QQuickMenu's selected index. With the current change we guarantee that the selected index (that is exposed as "currentIndex" in the public API) is updated only once, before any activated() signal is emitted. This also allows the handler of the activated() signal to update currentIndex at will, without running the risk of having it overwritten again by the ComboBox internal code. Task-number: QTBUG-51113 Task-number: QTBUG-43050 Change-Id: Ibfe12752d02eb4c9e2bf9a73ee8b3ab0ca8d7eaa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-021-1/+0
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Iab80dd0c2bea54171971fd7a9538000908ed90d5
| * 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>
* | ComboBox: update selectedText when model is changedTuomas Heimonen2016-06-151-0/+1
|/ | | | | | | | | When QML ComboBox's model is changed and currentIndex has not been changed, selectedText is now updated correctly. Task-number: QTBUG-53921 Change-Id: I778d196b3c69a29928bace9fd54b4118f0c78e9f Reviewed-by: J-P Nurmi <jpnurmi@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>
* 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 5.6Liang Qi2015-10-281-1/+1
|\ | | | | | | Change-Id: I7177ee6f1dc74d7f0d2ac9a3aedcc8d7a00cee41
| * Allow ComboBox to select items with empty textNikita Krupenko2015-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ComboBox checks selected text like a boolean value. This check is unnecessary and prevents from item with empty text could be selected. [ChangeLog][ComboBox] ComboBox is now able to select items with empty text. Task-number: QTBUG-42127 Change-Id: Ifaa0598d17c85cee099c88f4e03092137ba17c70 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Simon Hausmann2015-10-021-2/+1
|\ \ | |/ | | | | Change-Id: Ie26c941c33fdd8baab49dc13b84d02e2b83af5e1
| * Menus: Clean popup hide and destroy logicGabriel de Dietrich2015-10-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a menu popup gets closed it usually needs to be destroyed right away since we don't recycle its contents. There is an exception, however, and it's when he user triggers a menu item. In this case, we need to proceed in three steps. First, we hide the menu popup, then we emit the triggered signal, and when that one returns, the menu contents can be disposed. If we did all in a single step, we may end up with a crash since we don't support deleting a QtQuick item while it's running a signal handler. Delayed deletions don't work either in the case when the triggered handler ends up running the event loop. Task-number: QTBUG-45182 Task-number: QTBUG-47682 Task-number: QTBUG-48382 Change-Id: Ic39717e09f38df602f641250cd81cf4931863db6 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Make ComboBox work with mixed controls versionsMitch Curtis2015-09-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | Due to what might be a bug in QML, we can't assign an ExclusiveGroup object to an ExclusiveGroup property. Since Menu has a default property, we can't create ExclusiveGroup as a child object, so we create it as a child of the control instead. Change-Id: I5860b72a09823da33b82b4fc884cf69590f1c63a Task-number: QTBUG-48240 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Android: Add inputMethodHints to ComboBox controlBogDan Vatra2015-08-261-0/+44
|/ | | | | | Task-number: QTBUG-39088 Change-Id: Iaf57e8c5e6b92b63564fb015c3b13602acfeae8b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix ComboBox's activated signal documentation.Mitch Curtis2015-08-041-4/+5
| | | | | Change-Id: I48c49e3087308f7ef54514afebee38cd3843c7cc Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* ComboBox: Update selected text with item textSanttu Lakkala2015-06-231-1/+1
| | | | | | | | | Bind the text of a inactive ComboBox to the text of the selected popup menu item, so that the text updates when the model changes. Task-number: QTBUG-46611 Change-Id: Ieba4d8ee7d9b37390e805a3bde58bf546c5009b1 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-0/+1
|\ | | | | | | | | | | | | Conflicts: src/controls/qquickmenupopupwindow_p.h Change-Id: Ic935bb56f5df70645eea30c890759f5980d68fe4
| * Menu: Separate dismiss and destroy actionsGabriel de Dietrich2015-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids issues when the action is triggered from a Menu and the slot ends up processing pending events, effectively deleting an object while one of its QML signal handlers is being executed. The reason being that we used to call deleteLater() on the menu popup window while still in the mouse event handler. Now, we do the same thing in three separate steps. 1. Close/dismiss the menu popups, 2. trigger the action, and 3. delete the popups. This keeps the menu popups and their contents alive until we return from the action triggered handler. We also need to take care of manually destroying any popup we may create. Finally, the menu content creation in Menu.qml had to be tweaked since we shouldn't rely on the popup visibility anymore. Task-number: QTBUG-45182 Change-Id: I9f1155bbf74dd3353c6c4066a24abf1cd2c3a283 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Doc: Fix qml method signaturesCaroline Chao2015-03-131-3/+5
| | | | | | | | | | | | | | | | | | | | 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>
* | Doc: Fix qtdoc warningsCaroline Chao2015-03-061-3/+3
| | | | | | | | | | | | | | | | | | 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 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>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-201-1/+4
|\ \ | |/ | | | | Change-Id: I00fb1d7ed1351fb15d714a51a3d54154ee01bb1d
| * ComboBox: Fix opening popup when pressing space when editableKai Uwe Broulik2015-02-161-1/+4
| | | | | | | | | | | | Task-number: QTBUG-38612 Change-Id: I595c0b18f4cb88dc2948f869201cb944afc06740 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devJ-P Nurmi2015-02-121-1/+1
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/controls/TableView.qml tests/auto/controls/data/tst_gridlayout.qml Change-Id: I030bc50dc8fcf7b6b00e183dc3a67c3cd012f3fb
| * Disable hover on touchJ-P Nurmi2015-02-041-1/+1
| | | | | | | | | | | | Task-number: QTBUG-44267 Change-Id: I467f08ae6c5264b7e858022af9ff293117434018 Reviewed-by: Caroline Chao <caroline.chao@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>
* 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