aboutsummaryrefslogtreecommitdiffstats
path: root/src/controls
Commit message (Collapse)AuthorAgeFilesLines
* Fix style inheritance for popupsJ-P Nurmi2016-01-082-30/+40
| | | | | | Change-Id: I7bc36cb68e8d668fff2270e018de7eb1c71ccd20 Task-number: QTBUG-50347 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickStyleSelector: don't include an empty style name as a selectorJ-P Nurmi2015-12-231-1/+4
| | | | | | | | | | | | | | | | | | | This solves the recently surfaced QML import issue: ASSERT failure in QQmlImportDatabase::importDynamicPlugin: "Internal error: Plugin imported previously with different uri", file /home/qt/work/qt/qtdeclarative/src/qml/qml/qqmlimport.cpp, line 1947 Because QQuickStyleSelector included double slashes, the path ("Qt/labs/controls//") got converted to a uri with an extra dot in the end ("Qt.labs.controls."), which conflicted with the actual uri "Qt.labs.controls". Somehow related to qtbase commit 2e1de7f which changed QUrl behavior with local files. Change-Id: I8236a685a68dcffcd5f03c439236b2e8ea04492e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Replace Q_DECLARE_TYPEINFO(T, Q_COMPLEX_TYPE) by QML_DECLARE_TYPE(T)J-P Nurmi2015-12-211-2/+2
| | | | | | | | | | | Q_COMPLEX_TYPE tells Qt containers that the type has a ctor/dtor and that it may not be moved in memory using memcpy(). QML types are never stored by value in Qt containers (non-copyable QObjects), so the type info declaration is superfluous. QML_DECLARE_TYPE, however, is useful (QTBUG-49920) and consistently used for all QtQuick types. Change-Id: I3bd1718b306fa7af85a623fa7a17e1b9653d2152 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Use QFileSelector for qtlabscontrols.confJ-P Nurmi2015-12-191-1/+3
| | | | | | | | | | | Allows setting different defaults for different platforms, for example: qtlabscontrols.conf:Style=Default +android/qtlabscontrols.conf:Style=Material +windows/qtlabscontrols.conf:Style=Universal Change-Id: Ie84408f996bd665c343c2d73d5ec26c37c6c2491 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickPaddedRectangle: fix antialiasing issuesJ-P Nurmi2015-12-171-5/+18
| | | | | | | Use a transformation node to set the position of the rectangle node. Change-Id: Ic9d8f03d0921236556d363cc66ff2fe66ce296e4 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Make QQuickStyleSelector case-insensitiveJ-P Nurmi2015-12-141-3/+3
| | | | | | | | | | | | | | | | | This is especially nice for qtlabscontrols.conf: [Controls] Style=material vs. [Controls] Style=Material Previously, only the first syntax worked. Change-Id: Ib4a47dca002acb5c0227f3dcfea7251296f8386e Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Remove QQuickStyleSelector::instance()J-P Nurmi2015-12-142-8/+0
| | | | | | | | | | | It was a bad idea to share the same instance, because non-thread-safe instance() ends up being called from multiple threads. Let the style plugins create their own instances instead, QQuickStyleSelector ctor is not that heavy and there's no such shared state as originally was anticipated. Change-Id: Ie23091c6dd50f5d7abbab3b996da4471054da89a Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Read preferred style from qtlabscontrols.confJ-P Nurmi2015-12-141-0/+7
| | | | | Change-Id: I3aeed5c8316a099eed5ea8df25711193ee3c7d90 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add QQuickStyle::settings()J-P Nurmi2015-12-142-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loads ":/qtlabscontrols.conf" from resources. The next step is to make it possible to specify the preferred theme and accent in qtlabscontrols.conf. Different values can be specified for each style, which will take effect when running the app using the respective style. These are the preferred or default values, which can be overridden in code. [Controls] Style=material [Universal] Theme=Dark Accent=Red [Material] Theme=Light Accent=Brown The reason for using our own qtlabscontrols.conf file instead of re-using qt.conf is that qt.conf is strictly purposed for specifying the standard Qt paths for deployment setups. If qt.conf missing paths for QLibraryInfo, Qt fails to load the platform plugin: This application failed to start because it could not find or load the Qt platform plugin "windows|cocoa|xcb". Change-Id: I8da7f0859f004db8adf585b830bce4aa8e7713a9 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickStyleSelector: don't inherit QObjectJ-P Nurmi2015-12-023-25/+17
| | | | | | | | Fixes the "QObject: Cannot create children for a parent that is in a different thread." -warnings. Change-Id: I94ed34c6c4c7a6b6507e91e74a354630b0ad6d04 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Add QQuickStyleJ-P Nurmi2015-12-023-0/+289
| | | | | | | | | Now that we have a good place for it, we can share a common base class for QQuickMaterialStyle and QQuickUniversalStyle. QQuickStyle implements the inheritance pattern for attached styles, in one place. Change-Id: I459d98f96ce7c6de1ce7ef716e859f459278d8ad Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Added QQuickProxyThemeLiang Qi2015-12-013-0/+281
| | | | | Change-Id: I0e34c99564f30aef9ab17a8faa4ead6fa3829f5f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickStyleSelector: add instance() static methodLiang Qi2015-11-302-0/+10
| | | | | Change-Id: Id2a412175f9907651d8e4e0fdacb624ac2444552 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickStyleSelector: move the style detection to constructorLiang Qi2015-11-301-6/+7
| | | | | | | Command line argument has more priority than environment variable. Change-Id: Id76f703d1d4395b6bae1a2e6be162a9250fb8dfa Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickStyleSelector: removed the env overrideLiang Qi2015-11-301-6/+0
| | | | | Change-Id: I0e42b339ddfff81ad9029cfbff14e21aee5178ff Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Rename QQuickFileSelector to QQuickStyleSelectorLiang Qi2015-11-264-0/+398
| | | | | | | Also moved to QtLabsControls lib. Change-Id: I8ed1256da2b9aa63db4ca3b51a0ace3ba730e542 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add QQuickPaddedRectangleJ-P Nurmi2015-11-234-0/+331
| | | | | Change-Id: I72c535c2be99d345e1474a70e5c639f3b5a68e10 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename libQtQuickControls to libQtQuickTemplatesJ-P Nurmi2015-09-16142-12487/+0
| | | | | Change-Id: I1e663bb7be2be8b3d4edf0c038862cc2150aec40 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* SwipeView: add index, view and isCurrentItem attached propertiesMitch Curtis2015-09-161-0/+1
| | | | | | Task-number: QTBUG-48052 Change-Id: I0d6d27cc352d999d8071b979349f2364f0edf74d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Ensure press-and-hold event keeps selectionGabriel de Dietrich2015-09-154-9/+64
| | | | | | | | | | | | | | | | | | | | This concerns TextField and TextArea. It is an almost universal UX pattern on touch platforms where the user long presses to pop the context menu up. In many cases the context menu is used for copy and cut operations, which means that poping it up should keep the selection. The implementation works by not forwarding the initial mouse press event to the parent class until we're sure it's not going to be a long press. If the long press timer is cancelled for any reason, we will then send the delayed mouse press event to the parent class followed by whichever event triggered the cancellation. Auto-tests refactored and updated. Change-Id: If3aa8075f07a80929f4bd723895d9599bf8d169e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* QQuickStackView: fix buildLiang Qi2015-09-152-3/+2
| | | | | | | error: no member named 'qmlGlobal' in 'QQmlV4Function' Change-Id: I45610c13e634b341fe5a77a37a05633f5f211f0c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Controls: move Accessible from QML to C++Liang Qi2015-09-1428-9/+317
| | | | | | | | | | | Controls 2.0 could be built with QT_NO_ACCESSIBILITY defined. Added a few helper functions for accessible in QQuickControl. Don't set text as Accessible.name for TextArea and TextField. Change-Id: I40383bbcec2f8c742f709bdec0209623f80da449 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Apply QQuickControl font behavior to QQuickLabelLiang Qi2015-09-145-13/+136
| | | | | | | In 0addfd5d, we missed QQuickLabel. Change-Id: Icc352f8db04b2b981d386513454650e376f0a955 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add missing QColor includeLiang Qi2015-09-111-0/+1
| | | | | | | Fix complilation with -no-pch option. Change-Id: I169c39cf51cb6d3776636f043553ac3bf17a068d Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add ExclusiveGroup::checkablesJ-P Nurmi2015-09-102-10/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | Exclusive checkables typically share the same parent item. For example, a row or column positioner or layout. This change makes it convenient to handle such cases so that one can add the whole list of children to an exclusive group, without the need of creating any attached objects. Column { id: column ExclusiveGroup { id: eg checkables: column.children } Switch { id: s1; text: qsTr("First") } Switch { id: s2; text: qsTr("Second") } Switch { id: s3; text: qsTr("Third") } } Last but not least, this allows breaking the C++ dependency between QQuickTabBar and QQuickExclusiveGroup. Change-Id: Ic75065b87ef8fa532f77118d740f04484994bbf0 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Add QQuickContainer::contentChildrenChanged() notifierJ-P Nurmi2015-09-092-1/+3
| | | | | | | Makes possible to bind contentChildren to ExclusiveGroup::checkables. Change-Id: Idf9afabb93f78b012d2ca5c77fe79f34bf76e584 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickContainer: update variable namesJ-P Nurmi2015-09-091-6/+6
| | | | | | | | This piece of code was promoted from QQuickTabBar to QQuickContainer at some point -> "bar" looks confusing. Change-Id: I8e1c1c2233bf34ed3cfacbc539aeb98c2a945012 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* ApplicationWindow: remove contentWidth/HeightJ-P Nurmi2015-09-052-61/+1
| | | | | | | | | | | | | | As illustrated by QTBUG-48072, setting Window.minimumWidth and Window.minimumHeight automatically may cause very unpleasant surprises. Qt Quick Controls 2.x gives the user direct access to the header and footer items, so they can easily calculate the desired minimum, default and maximum sizes for the window. Change-Id: I974566ee81af63a3e9cfd0fa1c1fa36e3989548a Task-number: QTBUG-48072 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickControl: add font propertyLiang Qi2015-09-0210-35/+405
| | | | | | | | | 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>
* Minor doc improvementsFrederik Gladhorn2015-08-311-5/+4
| | | | | | | | Do not use fun abbreviations such as look'n'feel, but make it proper boring English. Change-Id: I6369058a455c04e0fc13b5bfff18f4e45b940c20 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* StackView: fix ownership issuesJ-P Nurmi2015-08-283-2/+8
| | | | | | | | | | | | | | | | | | | QTBUG-47317 revealed that dynamically created items remained visible after popping, so they were not only kept visible but also weren't properly destroyed. The visibility issue had to be fixed so that "indestructible" (not owned by StackView) were hid. This change tackles the destruction part, and marks pop-exit items for removal so they get destroyed when transitions are finished. Now that the transitionable items are actually destroyed, a new problem was releaved. We must not delete transitionable items until both enter & exit transitions have been finished. If we did that, the finished() callback would not get called for the pop-exit transition and tst_StackView::test_transitions() would fail (yay). Change-Id: Ie2eedf99d0366820260776591ad1f8b5b68e2ec3 Task-number: QTBUG-47317 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add a Qt Quick Controls porting guide.Mitch Curtis2015-08-282-1/+119
| | | | | | | | This can start off as just a table, but could be extended to its own doc page with snippets for each control type. Change-Id: I32ed00ebf7634c09f3c513c357b0ff6c6341c7ed Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* Add "Differences between Qt Quick Controls" section.Mitch Curtis2015-08-282-1/+110
| | | | | | | | | This will be seen immediately by users when they come to see what the controls are all about. It's good to be transparent about why the controls exist and why/when you'd want to use one module over the other. Change-Id: If5e891583d28bfb3b8f1ffd6d6e10846fb6f16a7 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* StackView: fix initialization of itemsJ-P Nurmi2015-08-272-25/+27
| | | | | | | | | | Only items that were created from pushed components were initialized. This change fixes item initialization for StackView::initialItem and pushed items. Change-Id: I6fe1afa233e63320180dfe8eac3874fed69cbb3b Task-number: QTBUG-47318 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* StackView: fix transitionsJ-P Nurmi2015-08-271-3/+3
| | | | | | | | | | | Passing null view bounds for the transitionable exit item helps to kick off the transition as appropriate. Otherwise the view transition item determines in QQuickItemViewTransitionableItem::prepareTransition() that no transition is necessary. Change-Id: Icb664725c4393ef3bb894b71a5912652f82c9da0 Task-number: QTBUG-47949 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Fix StackView: pushed items still showed up after being poppedJ-P Nurmi2015-08-271-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This is a partial revert of 6ee9612. The idea was to keep items visible until both transitions had finished. StackView { pushExit: null pushEnter: Transition { ... } } When both transitions had finished, all stack elements (except the current one) were hid. The problem was that in pop & replace operations the exiting item was no longer part of the stack (because it had been already popped out) and therefore was never hid. This change restores the original (intended) behavior that a null transition would equal to an immediate operation. This keeps the code simpler, and makes the behavior consistent in a sense that all items are hidden as soon the respective transition finishes. PauseAnimation can be used to wait if desired. Change-Id: Ia9e78506754bdc18949676f061dbfff28a7128b7 Task-number: QTBUG-47317 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Doc: Added more content about the StackView usageVenugopal Shivashankar2015-08-251-0/+158
| | | | | | | Reused content from Qt Quick Controls1 StackView. Change-Id: I0d21610ebec0b107a269f5acb9bde98c307f0acb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add documentation to module page, and remove overview page.Mitch Curtis2015-08-214-38/+71
| | | | | | | | | | | The overview page doesn't seem necessary; it's one more click that can be avoided by presenting the information that it contains on the index page. I didn't categorise the QML types as was done for Qt Quick Controls, because we don't have enough types to fill most of those categories. Change-Id: I8456fe219eb69983229712b0d9f5eef1f3a83ada Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* QQuickStackView: fix buildLiang Qi2015-08-201-1/+1
| | | | | | | | error: too many arguments to function call, expected 2, have 3 d->initializeObjectWithInitialProperties(*qmlGlobal.valueRef(), ipv, item); Change-Id: Ic8dd42102a80856f72d7ec5eba08dd8b5e82cf71 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add and update GIFs.Mitch Curtis2015-08-117-0/+6
| | | | | Change-Id: Ia3bb2b8a4bcbe98f6ceabeb4f57f254cd625bb37 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Slider: add animated GIF to documentation.Mitch Curtis2015-08-072-0/+2
| | | | | | | Also adds the manual test that allows the GIF to be regenerated. Change-Id: I90ddb770281a53d3ef342d7c6080664b74fe3b25 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Doc: Added documentation for the StackView QML typeVenugopal Shivashankar2015-08-071-2/+46
| | | | | | | Added a short description with a snippet Change-Id: I861647610e13a9e2209eb4449a20ace0373d3208 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Doc: Language edits to the existing Controls 2 documentationVenugopal Shivashankar2015-08-045-7/+6
| | | | | Change-Id: I546b8ef2343ba189b67c53036ee59c2547a93615 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* TextArea: Add pressAndHold signalGabriel de Dietrich2015-08-036-31/+216
| | | | | | | | We factorize the feature code identical to TextField's into a helper class. Change-Id: I4496f2d192a023f6a6c03ed81d81bca4c08a59d0 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Use Q_DECLARE_TYPEINFO for all classes.Mitch Curtis2015-07-2733-0/+74
| | | | | | | | | This is following the advice in the mailing list: http://lists.qt-project.org/pipermail/development/2015-July/022283.html Change-Id: I900f68c0cc6979f413016bb177446a1e93b01bc5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Fix issues in documentation configuration filesTopi Reinio2015-07-271-2/+9
| | | | | | | | | | - Use outputsuffixes variable to generate html filenames that do not clash with Qt Quick Controls/Extras 1.x - Fix 'examplesinstallpath' for Qt Quick Extras - Clean up and remove unneeded comments Change-Id: Ie2dae3af1181f9528630d78aaac8df693262afdf Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add pressAndHold support for TextFieldGabriel de Dietrich2015-07-242-1/+76
| | | | | Change-Id: I634da6568a456a5f21e30e6295d139a4e1a89e75 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickStackView: Properly validate sizesGabriel de Dietrich2015-07-211-2/+2
| | | | | Change-Id: If7378556edd3a024bf3973ae0f119007d232b5b3 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Make QQuickTextArea tab-focusableGabriel de Dietrich2015-07-201-0/+1
| | | | | Change-Id: I0c9626d091534a178a5e736c5977f1885faeccf2 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Make QQuickTextField tab-focusableGabriel de Dietrich2015-07-201-0/+1
| | | | | Change-Id: I66b4416979162122df822b6151f2e467cb8ab76f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>