aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/CheckDelegate.qml
Commit message (Collapse)AuthorAgeFilesLines
* Move Default style out into its own pluginMitch Curtis2020-08-261-110/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In upcoming patches, we start registering C++ types declaratively. A condition of doing so requires that each .pro corresponds to one QML module. This conflicts with the QtQuick.Controls import, which currently does quite a lot: - Registers (and selects) QML files for the style that was set - Registers private C++ utility types (such as IconLabel) that are useful for all styles under the QtQuick.Controls.impl import - Registers private C++ types that are only useful for the Default style (such as BusyIndicatorImpl). The reason it does so much can probably be explained by the intended usage of Qt Quick Controls 2; when you do import QtQuick.Controls 2.0 you get access to the QML types (e.g. Button) that the style you're using provides. So if you're using the Material style, you'll get a Material style button. API-wise, the button is identical to any other button, because the types in QtQuick.Templates are what we advertise as the public API. If we didn't have this functionality, users would need to import specific style imports to use controls, and the convenience of being able to simply start the application with a different style by e.g. passing an application argument would be lost. To support declarative registration of types while also supporting the existing use cases, we split out the Default-style-specific stuff into a QtQuick.Controls.Default import. Task-number: QTBUG-82922 Change-Id: Ib4f1620cae78d7acdc13d9ac0752a020bc22f3ea Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Tie minor version of all imports to Qt's minor versionMitch Curtis2018-11-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes all Qt Quick Controls 2 imports match the current Qt minor version, which is 12 as of this patch. It also updates all other Qt Quick imports to match. This will also make future version bumps easier as all version numbers in existing code/docs will match. The following commands were used to verify that no old versions remain: for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done [ChangeLog] From Qt 5.12 onwards, all import versions in Qt Quick Controls 2 follow the same minor version as Qt's minor version number. For example, the import version for Qt 5.12 is: "import QtQuick.Controls 2.12". Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3 Fixes: QTBUG-71095 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Take background insets into accountJ-P Nurmi2018-04-231-2/+2
| | | | | | Task-number: QTBUG-60156 Change-Id: I11f59a67f5a319ac5a4eae9b8ccea5d16a983de2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Align and cleanup implicit size bindingsJ-P Nurmi2018-04-201-2/+2
| | | | | Change-Id: I9f206c3c750fd648ba8761c574e0be94d32e940f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* AbstractButton: add implicitIndicatorWidth|HeightJ-P Nurmi2018-04-131-1/+1
| | | | | | | | [ChangeLog][Controls][AbstractButton] Added implicitIndicatorWidth and implicitIndicatorHeight properties. Change-Id: Ic9459efa76c12ba0df67dae0ffe103b14e011ee6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use implicitContentWidth and implicitContentHeightJ-P Nurmi2018-04-131-2/+2
| | | | | | | A simple search'n'replace change without hidden functional changes. Change-Id: I11c76846028665e66dfc6b4359adb33f77cd88ae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use implicitBackgroundWidth and implicitBackgroundHeightJ-P Nurmi2018-04-121-2/+2
| | | | | | | A simple search'n'replace change without hidden functional changes. Change-Id: I8e42f8ad30977630005529094eea726efa15a26d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickControl: update baseline offset automaticallyJ-P Nurmi2018-04-041-1/+0
| | | | | | | | | | | | ...unless explicitly defined. All buttons repeated the same binding. [ChangeLog][Controls][Control] Unless explicitly specified, baselineOffset is now automatically updated based on the top padding of the control and the baselineOffset of the contentItem. Styles no longer need to specify the baselineOffset in QML. Change-Id: I9c6f61371fee05a06b5dd31b27d8baf9da0bdeeb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Bump import versionsJ-P Nurmi2018-03-011-3/+3
| | | | | | | | QT_VERSION in qtbase has been updated. All the import numbers that now follow the Qt version can be updated. Change-Id: I4e9698201766b39807737c9e0279d36d4da686e2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Bump QtQuick.Templates import versionsJ-P Nurmi2018-02-231-1/+1
| | | | | | | | | | Unlike the other imports that are waiting for a Qt version bump, QtQuick.Templates contains version 2.5 registrations and is therefore already available. Bump the template imports to make the newly added APIs available, so we can start using horizontal|verticalPadding. Change-Id: I651feeeeadcc9767904ca6f191e844a03b8ddea6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-091-1/+1
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/quicktemplates2/qquickabstractbutton_p.h Change-Id: I265cbd2ce51beaf2afef99292c2e2798dadb4ba3
| * Default: fix CheckDelegateJ-P Nurmi2017-11-151-1/+1
| | | | | | | | | | | | | | | | | | A regression introduced by 0504150. A wrong binding for the x-coordinate was chosen while merging CheckIndicator back to CheckDelegate. Task-number: QTBUG-64430 Change-Id: Ia3b07e7537cc888406076c700ecd495a958cb7c1 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devJ-P Nurmi2017-11-061-3/+27
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquickchecklabel.cpp src/quickcontrols2/qquickchecklabel_p.h src/quickcontrols2/qquickmnemoniclabel_p.h src/quicktemplates2/qquickbuttongroup_p.h src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquickswipedelegate.cpp Change-Id: I1278b78dcaf25be5698f34751193b83dc951eb3c
| * Default: merge CheckIndicator back to CheckBox & CheckDelegateJ-P Nurmi2017-11-021-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal CheckIndicator helper was introduced together with CheckDelegate in 1acb34a, because we naturally wanted to share the indicator instead of duplicating it. This change is controversial, because it leads to duplicate code, but keeping the indicator definitions inline is clearly faster. This is not seen as a huge problem for the Default style, because the indicator is not too complicated. Basically, this fixes a ~5% performance regression introduced by 1acb34a. Before: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml [...] Average: 72.8 frames; using samples; MedianAll=73; StdDev=1.48324, CoV=0.0203742 After: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml [...] Average: 77 frames; using samples; MedianAll=77; StdDev=1.41421, CoV=0.0183664 Change-Id: Ibee0e29e83a64ee4a6a772a90b1784a9c8c715bb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-051-1/+1
|\| | | | | | | Change-Id: I59e9e2044184f96f1e66577f6f639d028a825b9e
| * Default: make delegates use palettesJ-P Nurmi2017-09-271-1/+1
| | | | | | | | | | | | Task-number: QTBUG-63369 Change-Id: Ie25329442763920b905c857c275472abaff9957c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devJ-P Nurmi2017-09-251-2/+2
|\| | | | | | | Change-Id: If4e13f09012c80c1043fd0ee82bbddab50b1fad5
| * Default: use palette.textJ-P Nurmi2017-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | Make editors and delegates use the "text" color role from palettes. This color role is normally used as a foreground color for the "base" background color. Task-number: QTBUG-63331 Change-Id: Ic08463f54c1b04a4eccf791a576ae792f75bf89b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Bump import versionsMitch Curtis2017-09-191-4/+4
|/ | | | | | | | This brings all QtQuick 2.x and QtQuick.Controls.x 2.x imports in src/ up to 2.11 and 2.4, respectively. Change-Id: Ica2413b85f5da62a495a5d1b02ea54a9a92c0ecb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Bump QtQuick 2.9 imports to 2.10Mitch Curtis2017-09-061-1/+1
| | | | | Change-Id: I274146911cd8a204fcbf439da9259b0a38c8092e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Default: make icon color match text colorMitch Curtis2017-05-021-1/+1
| | | | | | Task-number: QTBUG-60502 Change-Id: Id877eb72bfda6ca8877002b69ffdbb85ceb901fc Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* CheckDelegate: add support for iconsJ-P Nurmi2017-04-191-5/+11
| | | | | | Task-number: QTBUG-49820 Change-Id: I8644767d8d739337af1fe0fd29f87fea300752fb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update the import statements 2.2->2.3J-P Nurmi2017-03-011-3/+3
| | | | | Change-Id: Ifa2a4cb46f0fc7db75b468a67000c979bf44848c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Bump the QtQuick import versions in the stylesJ-P Nurmi2016-12-191-1/+1
| | | | | | | | | | | | | | Qt 5.9 == QtQuick 2.9 Change-Id: I7d4f749645011c4e78bdafe80824b83bd166e7c7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Update import versions in src/import/controls - part IIJ-P Nurmi2016-11-231-1/+1
| | | | | | | | | | | | | | The templates imports were missed in fb7c9541, sorry. Change-Id: I9742f1a86b01083ae1b7c6ae48b43098be8385c5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Update import versions in src/import/controlsJ-P Nurmi2016-11-231-2/+2
|/ | | | | Change-Id: Ic6cd0450a13b965578a0ab8f590270f4e52ffca6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-6/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Get rid of the remaining qdoc markers in the Default styleJ-P Nurmi2016-11-011-6/+0
| | | | | | | | | | Change-Id: Id90911cbac46d2d68284abca08dc7165ace71113 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Update all QtQuick imports in src/imports/controlsJ-P Nurmi2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | Most were importing 2.6, some 2.4, and some 2.7. Use consistently the latest available Qt Quick version 2.8. This can be easily tracked to the corresponding Qt version. Change-Id: Ic231b3cc0cb5d2d5cf806fe11c4ff3fd557d09e0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Default: consolidate style colors into a singletonMitch Curtis2016-09-121-2/+2
| | | | | | | | | | | | | | | | This reduces all of the duplicate literals that we currently have. Task-number: QTBUG-55867 Change-Id: I28f1f646d25f2f6578d52b4ba96f8f0f3ad6706b Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-081-3/+3
|/ | | | | | | | | | | | Controls must import templates version 2.1 in order to "inherit" 1-revisioned properties, methods, and signals. So far, this has been done case by case, but it's less error prone and more clear to change them all. For example, if you ever see a source file pasted/linked somewhere, it's easy to identify the version it belongs to. Change-Id: I41609ec1a22bc05ac3e79f953a147ca42d9e0786 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix .impl importsJ-P Nurmi2016-04-231-0/+1
| | | | | | | | | | The .impl imports are not standalone modules. Make sure all .impl imports are paired with an import that registers the .impl namespace. The issue was exposed by an unrelated change, which suddenly made tst_accessibility:RadioButton fail. Change-Id: I6fe7c33d52c52f9153d9c8c99a9bd256471fb6b0 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* import Qt.labs.templates 1.0 => QtQuick.Templates 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | | | | | | Even though there never was such thing is QtQuick.Templates 1.0, we'll use version 2.0 to keep it in sync with QtQuick.Controls 2.0 (next step). The templates define (and in the future, revision) the API of the controls, so the two must have the same version or it will get messy. Docs and plugins.qmltypes will be updated in follow up commits. Change-Id: Idc2e76f32f348ba35eb4b1fa167c6868300aa910 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add QQuickAbstractButton::downMitch Curtis2016-04-151-2/+2
| | | | | | | | | | | | | | | | | This property will determine whether or not the button is visually pressed. Having such a distinction allows users more control over their controls. The patch also fixes the problem with ComboBox where pressing on the ComboBox when it's open would cause a delegate in the popup to show as being pressed. Unless explicitly set, this property follows the value of the pressed property. To return to the default value, set it to undefined. Change-Id: I29ecf325ed2ede125613f0c878b0427937599866 Task-number: QTBUG-51005 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Controls: update license headersJ-P Nurmi2016-04-141-1/+1
| | | | | | | This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. Change-Id: Ib653135662bfd353a73290539995e8e5be211587 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Expose checkable where necessary, instead of in QQuickAbstractButtonMitch Curtis2016-04-131-2/+2
| | | | | | | | | | | | | QQuickCheckBox, QQuickRadioButton and QQuickSwitch are inherently checkable, so having this property available to QML doesn't make sense. QQuickButton and QQuickMenuItem are the two classes that need to expose the property. Change-Id: Ic421c195295c4bef0fc934c98fa9e781d98c9b67 Task-number: QTBUG-51554 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add CheckDelegateMitch Curtis2016-04-111-0/+86
CheckDelegate is an item delegate that is used in lists, and can be checked and unchecked. It derives from QQuickItemDelegate and hence has background press effects. The order of the indicator and text is reversed (compared to CheckBox) to reflect what is most commonly seen on mobile. Change-Id: I6fdac226fe87247052389b2e49f6cf20d7be44fb Task-number: QTBUG-52208 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>