aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2
Commit message (Collapse)AuthorAgeFilesLines
* QQuickStyleSelector: fix built-in file selectorsJ-P Nurmi2017-05-201-2/+10
| | | | | | | | | | | | | | | | While selecting style files, the standard built-in platform and local file selectors ("+linux", "+macos", "+windows"...) must be prefixed with the standard file selector indicator ("+"). Previously the style selector would not pick up platform-specific style files unless they were supplied without the prefix. [ChangeLog][Controls][Styles] Fixed the style selection mechanism so that now it is possible to organize platform and locale-specific files into sub-directories, such as "+linux", "+macos", and "+windows". Change-Id: Ia44b6f14fd0247943486fd27609147827bda9666 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQuickIconLabel: ensure that icon color changes are respectedMitch Curtis2017-05-152-10/+2
| | | | | | | | | | | updateIcon() is no longer called, so we can move its contents into syncImage(), which is called by updateOrSyncImage(), which is called by QQuickIconLabel::setIcon().. which is called each time any of the icon properties change (now that it's a value type). Task-number: QTBUG-60807 Change-Id: Id1ff875e0855bd76755d49466f82c2eac36ffd09 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Make QQuickIcon a value typeJ-P Nurmi2017-05-103-37/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickIcon no longer inherits QObject, but becomes a light-weight implicitly shared Q_GADGET-type, that is passed by value the same way fonts and colors are. Before: SUB: OS: Fedora 25 (Workstation Edition) SUB: QPA: xcb SUB: GL_VENDOR: Intel Open Source Technology Center SUB: GL_RENDERER: Mesa DRI Intel(R) Haswell Desktop SUB: GL_VERSION: 3.0 Mesa 13.0.4 SUB: running: benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml SUB: 110 frames SUB: 109 frames SUB: 109 frames SUB: 109 frames SUB: 109 frames SUB: Average: SUB: 109.2 frames; using samples; MedianAll=109; StdDev=0.447214, CoV=0.00409536 After: [...] SUB: running: benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml SUB: 123 frames SUB: 124 frames SUB: 124 frames SUB: 122 frames SUB: 125 frames SUB: Average: SUB: 123.6 frames; using samples; MedianAll=124; StdDev=1.14018, CoV=0.00922472 Change-Id: I604532204fb94fc0726d0c9b8b6097f9ebc265e8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-031-0/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/universal/CheckDelegate.qml src/imports/controls/universal/RadioDelegate.qml src/imports/controls/universal/Switch.qml src/imports/controls/universal/SwitchDelegate.qml Change-Id: I9bca4b8d9ce3f6c5c7589daa0ced7d0353f42efc
| * Mark non-default styles as depending on features.quickcontrols2-defaultStephan Binner2017-05-031-0/+2
| | | | | | | | | | Change-Id: I1472d2f72cf86e2ba66c9cccffbad73061100974 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconImage: use QQuickPixmap::width/height instead of implicitSizeMitch Curtis2017-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickPixmap's implicitSize is the original size of the image on disk before any scaling was done on it, which means that it doesn't account for the scaling that QQuickImageProviderWithOptions::loadSize() does. This was causing updateFillMode() to alternate between setting PreserveAspectFit and Pad when the icon color was changed. I was not able to come up with an auto test that reproduced the issue. Task-number: QTBUG-60528 Change-Id: I1cc31f0c50875d794c37a6fc76ff0942e44d271a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconImage: fix file selectors for named theme iconsJ-P Nurmi2017-04-262-2/+11
| | | | | | | | | | | | | | | | | | QQuickIconImage needs to be associated with a QML context to be able to call QQmlContext::resolvedUrl(), which in turn passes it to the URL interceptor aka. QQmlFileSelector. Change-Id: Iff34fb8316c765ac0ff04d5d7a6ab23002b31385 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickXxxImage: don't attempt to colorize null imagesJ-P Nurmi2017-04-192-8/+12
| | | | | | | | | | | | | | | | | | | | | | QPainter threw such warnings: QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active Task-number: QTBUG-60200 Change-Id: I2cdedb7a547d0c069964929663297c969de9b2a7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Replace QQuickColorImageProvider with QQuickColorImageJ-P Nurmi2017-04-183-37/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that QQuickImage is exported, we can colorize images using a simple QQuickImage subclass instead of using an image provider. The main issue with QQuickColorImageProvider was that it was based on QGuiApplication::devicePixelRatio(). Now each QQuickColorImage handles its device pixel ratio correctly depending on which screen it is on. Even though we now have to use two bindings (color and source) instead of encoding the color to the source, at the same time we can remove the sourceSize bindings that were added as image provider specific high DPI workarounds (ca87ab8). Task-number: QTBUG-58925 Change-Id: Iba14d2afe3bda540189682ba5be7c58d907d88f7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickIconLabel: reduce the amount of implicit size re-calculationJ-P Nurmi2017-04-121-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: Average: 124.6 frames; using samples; MedianAll=125; StdDev=0.894427, CoV=0.00717839 After: Average: 134 frames; using samples; MedianAll=134; StdDev=0.707107, CoV=0.00527692 Task-number: QTBUG-59746 Change-Id: I67dac9e51aba908e2a22f64a2b2c906d4a6b573b Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconLabel: use QStringLiteral instead of QLatin1StringJ-P Nurmi2017-04-121-2/+2
| | | | | | | | | | Change-Id: I4028890dafcd4c79b26a9592045d5e2825dd100d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconLabel: create icon and label items lazilyJ-P Nurmi2017-04-113-70/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: Average: 120.2 frames; using samples; MedianAll=120; StdDev=0.447214, CoV=0.00372058 After: Average: 129.8 frames; using samples; MedianAll=130; StdDev=0.447214, CoV=0.00344541 Task-number: QTBUG-59746 Change-Id: I44b521688cd60e7e287968828f9d4062cc642a0d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Implement QQuickIconLabel::TextUnderIconJ-P Nurmi2017-04-112-4/+42
| | | | | | | | | | | | | | This will be the default for TabButton and RoundButton. Change-Id: I9ccb0d35f33a80fe7e3da26617ed6f42232afe17 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add QQuickIconLabel::alignmentJ-P Nurmi2017-04-113-29/+76
| | | | | | | | | | | | | | | | The contents of menu items and item delegates must be aligned to the left in left-to-right UIs, or to the right in right-to-left UIs. Change-Id: Ib4064f6a8162306d446189cadebb80e12d3cd35d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconLabel: final propertiesJ-P Nurmi2017-04-101-6/+6
| | | | | | | | | | | | | | | | Another micro-optimization to tell the QML engine that it doesn't need to lookup potentially overshadowed properties in the class hierarchy. Change-Id: I87ec48823afee2bbc93027dd098c4e73f37bca59 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconLabel: don't post-pone implicit size calculationJ-P Nurmi2017-04-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | QQuickText is optimized to avoid unnecessary implicit size calcuation. It can make a big difference whether QQuickText::implicitWidth() is called while the text element is complete. "Bind" to QQuickText's implicit size directly to let it apply the optimization tricks. This way QQuickTextPrivate::setupTextLayout() is called only once during the construction of QQuickIconLabel. Only layouting is post-poned until component completion anymore. Change-Id: Ide6bbddadf7d36ab908064b8545e1b4ed9474455 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickIconLabel: use setSize() and setPosition()J-P Nurmi2017-04-101-16/+16
| | | | | | | | | | | | | | | | | | Calling setWidth() & setHeight() or setX() & setY() calls the virtual geometryChanged() method twice. Calling setSize() or setPosition() does the move/resize operation in one go. Change-Id: I136b9be1443e6ec11407081010aadc493417c627 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Micro-optimize QQuickIconLabelJ-P Nurmi2017-04-101-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | Reduce indirection between the public and private objects. Things like width, height, and componentComplete can be accessed directly in the private object instead of asking them from the public object, which in turn asks them from the private object. Furthermore, when direct access is available on the stack, reference directly instead of repeatedly via the d-ptr. Change-Id: Idbb40bc86ebff7b7b22e21050941afd6f0027bfe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickIconLabel: rename text property to labelMitch Curtis2017-04-083-38/+38
| | | | | | | | | | | | | | | | In preparation for the next patch which adds a "QString text" property to the API. Change-Id: Ie904108353c37a02cbc992c067f3e09aed9c2497 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconLabel: remove change signalsMitch Curtis2017-04-082-31/+9
| | | | | | | | | | | | | | No QML code relies on these. Change-Id: I9311d80b8d53914e1db7aa37ed9388c279f0563a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Rename QQuickDisplayLayout to QQuickIconLabelMitch Curtis2017-04-074-87/+87
| | | | | | | | | | | | | | | | There are some performance improvements planned that require changes to the class, resulting in it no longer being a layout "container". Change-Id: Ie29f2f95eebb64b3b018746f93763fdbe79625f0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickDisplayLayout: call layout on child item implicit size changesMitch Curtis2017-03-231-0/+2
| | | | | | | | | | | | | | | | | | This is necessary when the layout has an explicit size larger than its implicit size, and hence child item implicit size changes don't trigger geometryChanged() (where layout() is called). Change-Id: Ieacebff50503c101358e1dd6fda85ac495120af7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickDisplayLayout: only use spacing if the image's width is > 0Mitch Curtis2017-03-221-2/+2
| | | | | | | | | | Change-Id: I4b6b36da99633d5f9eebf090c5f0d8a3d2829e12 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickAttachedObject: add pimpl supportJ-P Nurmi2017-03-222-0/+8
| | | | | | | | | | | | | | | | Allow passing QObjectPrivate, so sub classes can use pimpl if they want, like the old QQuickPalette implementation already does... Change-Id: I48b6256bf63cb91697753ba9b5644c649574fdb0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickAttachedObject: align attaching and detachingJ-P Nurmi2017-03-222-11/+28
| | | | | | | | | | | | | | | | | | | | At construction time it was casting the parent to an item and falling back to popup if it wasn't an item, but at destruction time it was only doing the item cast. Unify the two so that both paths are tested when detaching too. Change-Id: Ic94d7686600d3502e195ded2d7007cb0fef76764 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickIconImage: only call updateIcon() when necessaryMitch Curtis2017-03-221-1/+1
| | | | | | | | | | | | | | | | Unconditionally updating the icon was causing binding loops when changing the spacing of a Button with icons. Change-Id: Ie8511afea7ebc365a28f954091d9cc22883d2e40 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Rename QQuickStyleAttached to QQuickAttachedObjectJ-P Nurmi2017-03-223-79/+79
| | | | | | | | | | | | | | | | | | This is becoming a generic recursive attached object type that can be used for palettes too, which are planned to be used for the upcoming image-based style. Change-Id: I693d307ea16e73540ec9519b2ab18a314ff44272 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Move isDarkTheme() to QQuickStylePrivateJ-P Nurmi2017-03-223-21/+21
| | | | | | | | | | | | | | | | | | QQuickStyleAttached is being generalized to a recursive attached object type that can be used for palettes too, which are planned to be used for the upcoming image-based style. Change-Id: I4c1d25624ee11bb0ec6cd5ee2656c36e622e2139 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Move settings from QQuickStyleAttached to QQuickStylePrivateJ-P Nurmi2017-03-224-25/+22
| | | | | | | | | | | | | | | | | | | | The settings were added before QQuickStyle(Private) existed. Now QQuickStyle(Private) is a lot more logical place for the settings that are not specific to the attached style attributes only, but can be also determine which style is used etc. Change-Id: I7bc432c330d58ab501b51b0ee8eaf24697155324 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickDisplayLayout: test that spacing is correct with only icon/textMitch Curtis2017-03-211-2/+5
| | | | | | | | | | | | | | The effective spacing when either the icon or the text is null is 0. Change-Id: I5ce2388a17be5e86d3461b5c23f1c3996779b52f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add QQuickDisplayLayoutMitch Curtis2017-03-174-0/+643
| | | | | | | | | | | | | | | | | | This class lays out an icon and text in various configurations, depending on the display property. Task-number: QTBUG-49820 Change-Id: I2ace443e6cb134a1032b0b79378abd2179916133 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add private Color singletonMitch Curtis2017-03-163-0/+122
| | | | | | | | | | | | | | This will be used by various styles. Change-Id: I50b22c1fab04e7fd8fb1fe0b74630c721b6f8c6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add IconImageJ-P Nurmi2017-03-084-0/+387
|/ | | | | | | | This adds an internal helper item that will be used for showing icons on various controls (in follow-up commits). Change-Id: I792b423737023ba663211371f82fedb2b92857bb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Make QQuickStyleSelector::select() more robustJ-P Nurmi2017-03-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | While debugging QTBUG-59026, I found out that QLocale::name() is empty with the "C" locale. Because the empty locale name was used as a selector in QQuickStyleSelector, it ended up registering QML types using URLs that contained a double slash (empty locale selector matched): QtQuick/Controls.2/Material//RadioButton.qml At the same time, the QML engine imported implicitly internal QML types constructing the URLs directly based on the location on the file system without a double slash: QtQuick/Controls.2/Material/RadioIndicator.qml As a result, the same QML module ended up having types registered from two different URLs, which is not allowed. This change simply prevents both problems. First of all, if the locale name is empty for any reason, it won't be added anymore to the list of selectors. Furthermore, the final selected URL is normalized to avoid redundant dashes. Task-number: QTBUG-59026 Change-Id: I19b890451aaddfe4277bb6b26bc3c1394a75a704 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Provide more context for the configurable feature descriptionsJ-P Nurmi2017-02-081-2/+2
| | | | | Change-Id: I962d8150583cc1637cbb8d6fb7399b8f408b186e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix -no-feature-shortcut buildJ-P Nurmi2017-02-072-0/+4
| | | | | Change-Id: If567b99889b40528150834c3319cdfec8e5b229e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make styles configurable featuresJ-P Nurmi2017-02-062-0/+41
| | | | | | | | | | | | | | | ./configure [...] Qt Quick Controls 2: Styles ................................. Default Material Universal Supports both syntaxes: -(no-)style-[material|universal] -(no-)feature-quickcontrols2-[material|universal] Change-Id: I011cc38e5752d2c718376ca7493940271920b3e1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tumbler requires ListView and PathViewJ-P Nurmi2017-02-021-4/+9
| | | | | Change-Id: Ieb40f536cc5d68fdf13075df2c9b3e09d5077de3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix build with -no-feature-settingsJ-P Nurmi2017-01-311-0/+2
| | | | | Change-Id: I204c50539288df16c4d4010e91c8ecc60f202ec6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Update the remaining copyright yearsJ-P Nurmi2017-01-112-2/+2
| | | | | | | Already done in 5.8 (00a0626) - these files are new in dev. Change-Id: I534c7512a69d4c24ed9ce8191325556beb0fb1f7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-1120-20/+20
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-0920-20/+20
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Editors: fix placeholder text alignmentJ-P Nurmi2017-01-103-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal QQuickPlaceholderText creates an "implicit binding" to the editor's horizontalAlignment, meaning that the placeholder respects the editor's horizontal alignment when explicitly set, and otherwise determines the alignment from the placeholder text's visual direction. [ChangeLog][Controls][TextField] Fixed the horizontal alignment of the placeholder text in right-to-left UIs. [ChangeLog][Controls][TextArea] Fixed the horizontal alignment of the placeholder text in right-to-left UIs. Task-number: QTBUG-55999 Change-Id: If1a8596c35c1920874996277520f1c54430c5f69 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-12-013-13/+32
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/SpinBox.qml src/imports/controls/material/SpinBox.qml src/imports/controls/universal/SpinBox.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ie1d1f487890f0a9f80a00df5e813e1d2e8303fe5
| * Allow specifying a relative style path in qtquickcontrols2.confJ-P Nurmi2016-11-303-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The style path is resolved relative to the location of config file. Even though qtquickcontrols2.conf is normally located in the root of resources, Quick Designer uses QT_QUICK_CONTROLS_CONF to set a custom location for the preview, where the standard config location is not feasible. This patch extends the config and style lookup further by allowing to specify a relative path to a custom style for the Quick Designer preview. Change-Id: Iad9c459421eefbf7a5bcbedfea59f5f16a1d3a39 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-11-171-1/+19
|\| | | | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquickstyle.cpp src/quicktemplates2/qquickslider.cpp Change-Id: Ie12132690680706def6f516334a6ef0ba27336b3
| * Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-171-1/+19
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/controls/data/tst_button.qml Change-Id: I5c97b3c1944e52dba44fd3c7d6d9a255c5e08cf7
| | * QQuickStyle: kill the temporary QQmlEngine instanceJ-P Nurmi2016-11-171-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The temporary QQmlEngine instance is not only slow and ugly, but also causes random crashes in the CI. This change replaces the temporary QQmlEngine instance with a local defaultImportPathList() helper method, which is based on the code in QQmlImportDatabase constructor. Later on, we can switch to QQmlImportDatabase::defaultImportPathList() when it has been made available in dev. Change-Id: I9f8363ba79ce39fb0482e6e44be0b1d1040c76e4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Add support for a QT_QUICK_CONTROLS_STYLE_PATH environment variableJ-P Nurmi2016-11-161-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls][Styles] Added support for a QT_QUICK_CONTROLS_STYLE_PATH environment variable, which can be used to specify lookup paths for Qt Quick Controls 2 styles. This allows device manufacturers and Linux distributions to specify a system-wide style installation folder that may be located outside the Qt installation tree. Change-Id: Ic004d693bf6206971da6319d0cc13061b8fd1566 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | QQuickStyle::availableStyles()J-P Nurmi2016-11-103-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to introduce platform-specific styles, such as the iOS style, and make them appear correctly in the Gallery example so that we don't have to hard-code the lists separately for different platforms. [ChangeLog][Controls][QQuickStyle] Added availableStyles() method that returns the list of available built-in styles. Change-Id: Ieea88577f402cbc52a844d6777e64c6bd55c5ab9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>