aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_control.qml
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Control: fix background sizeJ-P Nurmi2018-04-231-0/+6
| | | | | | | | | | | | Don't reset QQuickItemPrivate::widthValid and heightValid flags, because that will cause the item to update its geometry when its implicit size changes. Instead, keep track whether background has an explicit size at the time of assignment, or if the background changes its geometry outside of resizeBackground(). Task-number: QTBUG-66455 Change-Id: If14eeae6863f7e5e47ebf2d6dbdaf718fc8368d4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Control: add support for background insetsJ-P Nurmi2018-04-231-0/+146
| | | | | | | | | | [ChangeLog][Controls][Control] Added topInset, bottomInset, leftInset, and rightInset properties to control the geometry of the background similarly to how paddings control the geometry of the contentItem. Task-number: QTBUG-60156 Change-Id: Id8228d32f6a5fffeb771964a153ee062a5a083b5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Control: add implicitContentWidth|Height propertiesJ-P Nurmi2018-04-131-0/+47
| | | | | | | | | [ChangeLog][Controls][Control] Added implicitContentWidth and implicitContentHeight properties that can be used to simplify complex implicit size bindings. Change-Id: I6ccef572c013605058808ce2ad17f8bd82f49ef0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Control: add implicitBackgroundWidth|Height propertiesJ-P Nurmi2018-04-121-8/+36
| | | | | | | | | | [ChangeLog][Controls][Control] Added implicitBackgroundWidth and implicitBackgroundHeight properties that can be used to simplify complex implicit size bindings. Task-number: QTBUG-60156 Change-Id: Ia68df187c2a458c84de19f867d76a643134e8b69 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickControl: update baseline offset automaticallyJ-P Nurmi2018-04-041-0/+38
| | | | | | | | | | | | ...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>
* Add Control::horizontal|verticalPaddingJ-P Nurmi2018-02-131-0/+213
| | | | | | | | | | | | | | | | | | | | | | | | | A common pattern for paddings: padding: X topPadding: Y bottomPadding: Y This pattern can be simplified by providing separate horizontalPadding and verticalPadding properties: padding: X horizontalPadding: Y The actual style changes will be applied separately. As a bonus, the size of QQuickControlPrivate can be reduced a bit since we can move the (has)top/left/right/bottomPadding members to ExtraData. [ChangeLog][Controls][Control] Added horizontalPadding and verticalPadding properties as a convenient way to set both left and right, or top and bottom paddings in one go. Change-Id: I3a93b6f9ab988d806b1f263e74b6bd6b5427fbbe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update license headers to silence qtqa/tst_license warningsJ-P Nurmi2017-02-241-2/+12
| | | | | | | | | | Sync with the qtbase/header.XXX. The license headers were matching qtbase/header.XXX-OLD, which makes qtqa/tst_license flood warnings: Old license being used for foo.qdoc Change-Id: I199bf303a2d648e0d5f7bc01cb0814a5f945eeff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_controls: update import versions for controls and templatesJ-P Nurmi2017-01-121-2/+2
| | | | | Change-Id: I104bc44c361351719449cab94dcb14c96e91e32f 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>
* | tst_control: use TestCase's new createTemporaryObject functionsMitch Curtis2016-12-161-39/+15
|/ | | | | | | | This ensures that the appropriate objects are destroyed at the end of each test function, even if the test fails. Change-Id: Id5e5999c49592c030278a5d4b078b97dc8fbb829 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-2/+19
|\ | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * Clear hover when moved outside while pressingJ-P Nurmi2016-10-171-2/+19
| | | | | | | | | | | | | | | | | | | | As noticed in QTBUG-56269, QEvent::HoverLeave is not sent while there is an active mouse grabber item. Therefore we must hit test move events to figure out if the control is still effectively hovered. Task-number: QTBUG-56556 Change-Id: I8a5e3dbd77375aace7fc5594e4315288304d852f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make hoverEnabled propagate to childrenJ-P Nurmi2016-10-171-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10-071-19/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml src/quicktemplates2/qquickmenu.cpp tests/auto/controls/data/tst_buttongroup.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ib6042a0ad716f557927e7412d17ea8957d06c015
| * auto tests: prefer creating signal spies locally where neededJ-P Nurmi2016-10-071-19/+4
| | | | | | | | | | | | | | | | | | | | | | It is tedious to always add new static SignalSpy instances for each tested signal. Just create signal spies locally in the same place where they are used. This makes it much more convenient to create more signal spies to achieve better coverage. This practice has been already used in newly written tests. Change-Id: I7f56c4b3cea0c55c34b85254f69a88ec73b8607f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-221-0/+6
|\| | | | | | | Change-Id: I37aab846346692fd4bff08b0dbab66db3a8e2716
| * QQuickControl: clear the hovered state when hiddenJ-P Nurmi2016-09-151-0/+6
| | | | | | | | | | | | Task-number: QTBUG-56007 Change-Id: I6433e0ebc9570b1e9e6e149ef7f631ea6786f672 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-021-1/+28
|\| | | | | | | Change-Id: I82da1e547c4ead1181ade19f77c62651c00998a3
| * Make a plain Control calculate suitable implicit sizeJ-P Nurmi2016-08-311-1/+28
| | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Control] A plain Control now calculates its implicit size based on the implicit size of the content item plus paddings, and the implicit size of the background item. Change-Id: I086ecf8e3f564ee49df2f9d30015e127dc88db6e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-081-2/+2
|/ | | | | | | | | | | | 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>
* 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>
* tst_control: fix font testsJ-P Nurmi2016-03-211-20/+0
| | | | | | | | | We cannot assume that TextField and TextArea have the same default font than Control. This is no longer true for the Material style, which sets specific fonts for the editor controls since 63ed622. Change-Id: Ida26160b690fa0b4784c30f9e3b5a6211e9d743c Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-161-0/+48
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/controls/qquickstyle.cpp src/templates/qquickcontrol.cpp src/templates/qquickcontrol_p.h src/templates/qquickpopup.cpp tests/auto/controls/data/tst_combobox.qml tests/auto/controls/data/tst_control.qml Change-Id: Ib7853d5ee5c4444872cd5c2d789e20d229c955d1
| * Fix font comparisonsJ-P Nurmi2016-03-111-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When inheritance of explicitly set font attributes is involved, it is important to compare the resolve mask in addition to comparing the attribute values to avoid losing the information whether a specific attribute is set explicitly. For example, QFont::operator==() returns true for two fonts that are both bold regardless of whether only one of them has explicit weight set. Therefore, setFont() must not ignore fonts resolve mask. Furthermore, the fontChanged() notifier must be emitted only if the actual attribute values change, not if only the resolve mask changes. Change-Id: I2eb7a071c0eaecd2f8d2f6074c4ce6ed6764a6e9 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Move focusReason and focusPolicy tests to tst_focusJ-P Nurmi2016-03-151-66/+0
| | | | | | | | | | | | | | | | This speeds up 'make check' a bit. There's no reason to repeat these tests for all styles. Change-Id: I091f6430172d55dbf1974d88f81a383167b30f20 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Control: add hoverEnabled and hovered propertiesJ-P Nurmi2016-02-251-0/+21
| | | | | | | | | | | | Change-Id: I35946b9f13ef78ce7bdfbad9706de3e96bd48ea4 Task-number: QTBUG-50003 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add Control::focusPolicyJ-P Nurmi2016-02-221-0/+45
|/ | | | | Change-Id: I136aa08d5c1b96f168c4456a2a30b163b2004779 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Control: implement locale inheritanceLiang Qi2015-12-211-0/+185
| | | | | Change-Id: I2f16141b53dd44e471050ef6901ddc480c77895f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add QQuickControl::focusReasonJ-P Nurmi2015-12-121-0/+26
| | | | | | | | | This allows the Universal style ApplicationWindow to visualize key/tab focus with a focus rectangle, but hide the focus rectangle when the focus moves around for other reasons (mouse, active window, popups...) Change-Id: I5c5b43d7c4c051679e34b806ee43cd80180d7ab8 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Remove Control::layoutDirectionJ-P Nurmi2015-12-091-40/+9
| | | | | | | | Calculate QQuickControl::isMirrored() from LayoutMirroring.enabled (QQuickItemPrivate::isMirrored()) and QLocale::textDirection(). Change-Id: I0e391d27df732734031f3e94d9828a1a2cfa7474 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add Control::localeJ-P Nurmi2015-12-071-0/+13
| | | | | | Change-Id: I6c6647de6d286a92b35bca09a45e82cd3343a623 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Control: resolve the font a bit earlierLiang Qi2015-12-011-0/+51
| | | | | | | Also applied to QQuickLabel, QQuickTextArea and QQuickTextField. Change-Id: Icf10500905980445809eb2375e8957db2c41e03c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* tst_control: use pure templates for font testsJ-P Nurmi2015-10-291-6/+6
| | | | | | | The Universal style uses 15px font size by default. Change-Id: Iac60b0c61d085b7fceeefcd69bf4537f3e43c468 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Control: fix available sizeJ-P Nurmi2015-10-271-1/+47
| | | | | | | | | | | First of all, don't allow negative available size, because it doesn't make much sense. Secondly, geometryChanged() was comparing new width to old height, so availableHeightChanged() was emitted under wrong conditions. Furthermore, the comparisons should are better done fuzzy to avoid unnecessary change notifiers. Change-Id: Ic2bbc106670882b421f79db82d4b47d846e1c4e0 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename QtQuick.Controls 2.0 to Qt.labs.controls 1.0J-P Nurmi2015-10-011-1/+1
| | | | | Change-Id: I142622dd85e95ef70b11132e77ccf48701f2cabc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename QtQuick.Templates 2.0 to Qt.labs.templates 1.0J-P Nurmi2015-10-011-1/+1
| | | | | | Change-Id: I3263a600065dfa2bfe7334ec44a74e2dca83aa36 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Apply QQuickControl font behavior to QQuickLabelLiang Qi2015-09-141-0/+44
| | | | | | | In 0addfd5d, we missed QQuickLabel. Change-Id: Icc352f8db04b2b981d386513454650e376f0a955 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Use QtQuick.TemplatesJ-P Nurmi2015-09-091-7/+8
| | | | | Change-Id: I3d1822457efd740e7c9d91747e978d787c0dd4b8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* QQuickControl: add font propertyLiang Qi2015-09-021-0/+250
| | | | | | | | | When the font of a QQuickControl subclass is set, it will propagate it to all children that are also derived from QQuickControl, as well as TextField and TextArea. Change-Id: I7c851f84b89609094d9a81d239ade0f0ac212985 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Cleanup & improve auto testsJ-P Nurmi2015-06-291-9/+5
| | | | | | | | | - always verify component creation to catch errors early - remove empty init() and cleanup() functions - remove redundant "defaults" checks Change-Id: I39f16404fa2e3d3e38348742afd8f51ea36b2f05 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Revert "Rename Control::availableWidth/Height to contentWidth/Height"J-P Nurmi2015-06-181-16/+16
| | | | | | | | | | | TextField and TextArea have different semantics for contentWidth and contentHeight. In addition, it looks like we need to restore contentWidth and contentHeight for Frame & GroupBox. This reverts commit 6941b934bdf5f3c7b65f682c8dfc5c6562292351. Change-Id: Ia115025a67b472ac67fbbc915b80312e4b4a7431 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Rename Control::availableWidth/Height to contentWidth/HeightJ-P Nurmi2015-06-151-16/+16
| | | | | Change-Id: Ia39a52e7e8d968b05fd7a2d64ab3b3030a9f528e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Control::availableWidth & availableHeightJ-P Nurmi2015-06-031-0/+93
| | | | | | | | | The recently introduced contentWidth/Height was ambiguous. It had even different semantics than in Containers, TextXxx & Flickable etc. Thus, replace with availableWidth/Height. Change-Id: Iaeef25ec82b395c602724d222ca73666460ffd29 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Improve Control::background automatic resizingJ-P Nurmi2015-05-231-0/+46
| | | | | | | | - width follows only if x and width are both not specified - height follows only if y and height are both not specified Change-Id: Ib881daa9da339baac53f7f9d4de6e5bdad7723e2 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix Control::mirroredChanged() emissionJ-P Nurmi2015-05-231-0/+35
| | | | | | | | It was emitted only when LayoutMirroring.enabled changed, but it also needs to be emitted when layoutDirection changes... Change-Id: I9424fdf232c11669780c9abace5c162a0df69dbe Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Expose read-only bool Control::mirrored property for convenienceJ-P Nurmi2015-05-221-0/+6
| | | | | Change-Id: Icbb39aa1c3ac6f4b00adbc59c09a6c79e99bafd3 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Promote layoutDirection & effectiveLayoutDirection to ControlJ-P Nurmi2015-05-221-0/+91
Change-Id: I44df09c17d6d20cfd929af4e331e15f48b19587e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>