aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Doc: highlight examples on the index pageJ-P Nurmi2016-09-121-1/+3
| | | | | | | | | | | | This looks nicer that an "Examples" section with a bullet list that only contains a lonely "Qt Quick Controls 2 Examples" link. Manually listing those two examples that we currently have in the 5.7 branch together with an "All Examples" link may seem a bit silly for the time being, but the idea is that later on we highlight a few examples manually and the rest are accessible through the "All Examples" link. Change-Id: I329d812b7d269de607fa141552e35bae76041176 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Delete replaced delegates after Component.completed() is emittedMitch Curtis2016-09-1215-12/+101
| | | | | | | | | This avoids the issue "Object destroyed during incubation" error. A proper fix is still required in the QML engine. Change-Id: I3c168cfe2d8c295662bcb5886e99a0f95748e302 Task-number: QTBUG-50992 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Remove unused QQuickMaterialStylePrivate forward declarationMitch Curtis2016-09-121-2/+0
| | | | | Change-Id: Ibe09155db15603475e9060332191eb7f5223bfc1 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickDrawer: fix the internal transition stateJ-P Nurmi2016-09-064-60/+54
| | | | | | | | | | | | | | When QQuickDrawer was visible all the time, it did not emit the visibility related signals at all. Now the signals are emitted, but aboutToShow() and visibleChanged() were emitted twice when a drawer was manually dragged open. First time when the dragging begins (the drawer becomes effectively visible), and second time when the open transition begins after mouse/touch release. This change ensures that the signals won't be emitted again when the transition begins, in case they were already emitted. Change-Id: I2a175c9e86a480d5cd23e306f41f0d85e2416f75 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix drawer visibility and overlay event handlingJ-P Nurmi2016-09-066-96/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | Drawers were visible all the time, lurking at the window edges to be able to catch presses and drag themselves visible when appropriate. This change moves the handling of window edge presses from QQuickDrawer to QQuickOverlay, making it possible to show and hide drawers like any other popups. Instead of having all drawers visible all the time, we just keep QQuickOverlay visible when there are any registered drawers, even hidden ones. Furthermore, this change makes modal popup/drawer background dimming items accept mouse press events just like they accept hover events to ensure that a modal overlay does not leak input events through. When the background dimming of a modal drawer has been dragged over the drag-threshold, the drawer simply steals/grabs mouse to start dragging of the drawer. Task-number: QTBUG-54794 Task-number: QTBUG-54800 Task-number: QTBUG-55022 Task-number: QTBUG-55703 Task-number: QTBUG-55713 Change-Id: I65fb38fcf1466d4e41192c4321d80fb90b49da9a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::ungrabMouse()J-P Nurmi2016-09-062-47/+56
| | | | | | | | Split ungrabMouse() out of handleMouseReleaseEvent(). This makes the mouse release handling code a bit easier to read. Change-Id: Ibc1286083edb4f832b6e5ee761ee5c16a0e68ba1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::grabMouse()J-P Nurmi2016-09-062-32/+40
| | | | | | | | Split grabMouse() out of handleMouseMoveEvent(). This makes the mouse move handling code a bit easier to read. Change-Id: I39971e995d8d202e702bddeec0d1f9554c298c0e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::startDrag()J-P Nurmi2016-09-062-18/+29
| | | | | | | | | Split startDrag() out of handleMousePressEvent(). This makes the mouse press handling code a bit easier to read. The new method will be later utilized by QQuickOverlay. Change-Id: I1118d86657a77d72353faac928b0a8deba4ff501 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: fix ToolBar to respect Material.backgroundJ-P Nurmi2016-09-063-1/+10
| | | | | | Task-number: QTBUG-55687 Change-Id: I815291847bad72ae58b66dc70b510ce11cd88b8d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: fix popups to respect Material.backgroundJ-P Nurmi2016-09-061-0/+4
| | | | | | Task-number: QTBUG-55687 Change-Id: I217ad905cc06228a6a1608c0721dc20a31db6d9b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QQuickDrawerPrivate accessible via qquickdrawer_p_p.hJ-P Nurmi2016-09-053-28/+97
| | | | | | | | Required by the subsequent patches. Done separately keep the other patches smaller and easier to review. Change-Id: Ibce7f131684ef48a60c7023e7566d8b6907ac6af Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove superfluous QQuickOverlayPrivate::popupsJ-P Nurmi2016-09-052-4/+1
| | | | | | | | | | | | First of all, the name was a bit misleading. It was a list of _visible_ popups. Anyway, it is unnecessary to maintain such list anymore. The only use case for it was to resize the background dimming items of visible popups when the window was resized. For that infrequent desktop -only event, we can fetch the background dimming items from the list of all popups. Change-Id: Ie17db042719d4614189a78a2e5314136ca95df42 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: keep track of all drawersJ-P Nurmi2016-09-052-13/+6
| | | | | | | | Required by the subsequent patches. Done separately keep the other patches smaller and easier to review. Change-Id: Id5d13e19f98155cfd3d0474c7d3839808133bab1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: keep track of all popupsJ-P Nurmi2016-09-053-1/+27
| | | | | | | | Required by the subsequent patches. Done separately keep the other patches smaller and easier to review. Change-Id: I60212451cf53443ae7abd58b8eaad94b66984e03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QQuickOverlayPrivate accessible via qquickoverlay_p_p.hJ-P Nurmi2016-09-053-29/+97
| | | | | | | | Required by the subsequent patches. Done separately keep the other patches smaller and easier to review. Change-Id: I90ae08ea196354b3db74e2203983ca95733ef0c8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix hover event delivery with plain QQuickWindowJ-P Nurmi2016-09-051-9/+16
| | | | | | | | | | A plain QQuickWindow cannot provide a modal background dimming visual, but we can create a QQuickItem as a fallback to take care of blocking the hover events for modal popups. Change-Id: I3ead985c4e2e030aaf28f1ec6c8a1ae285637819 Task-number: QTBUG-54913 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use QQuickOverlay with plain QQuickWindowJ-P Nurmi2016-09-055-20/+33
| | | | | | | | | | | Get rid of the ugly and broken event filter approach that was used with QQuickWindow. Create an instance of QQuickOverlay so that the same overlay code path is used for both QQuickApplicationWindow and plain QQuickWindow. Task-number: QTBUG-55729 Change-Id: I6e26b19cd94a9580418912803f50c30b9dcaeedb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QQuickOverlay resize itselfJ-P Nurmi2016-09-053-8/+23
| | | | | | | | This prepares QQuickOverlay to be usable with a plain QQuickWindow, for which we cannot override resizeEvent(). Change-Id: Ib021c510539b134477bb8d532787721a5ac7fca4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TextField: improve the implicit size calculationJ-P Nurmi2016-09-053-8/+12
| | | | | | | | | | In general, we don't want TextField to grow while typing, but if there is no background nor placeholder, use content width as a fallback. Also take content height into account while calculating the implicit height. Task-number: QTBUG-55684 Change-Id: Iee0eff6861c3573045036a06d7e53f7fc313fbe8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Switch: fix missing pressed() and released() signalsJ-P Nurmi2016-09-051-1/+5
| | | | | Change-Id: I4bf81c06a77980ed3201b43f9d106017f236a8bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: mention Material.elevation in the docsJ-P Nurmi2016-09-051-0/+11
| | | | | Change-Id: I514a784df656d2690c8c2cb285cec8d48102b3be Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: ignore Material.background unless explicitly setMitch Curtis2016-09-021-1/+2
| | | | | | | | | | | | | | Doing Material.background: "red" in an ApplicationWindow shouldn't affect the background color of e.g. a Button. The background property should still propagate though, so we change buttonColor() to ignore the value of background if it wasn't explicitly set. Change-Id: I09b4df142935b19de35a77bd68c6c062417b74fc Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Cleanup unused QQuickMaterialStyle::drawerBackgroundColorJ-P Nurmi2016-09-022-7/+0
| | | | | | | Drawer uses Material.dialogColor Change-Id: I4af7c5920a3603685fdca9d39b23f7db9edd09df Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix velocity calculationJ-P Nurmi2016-09-021-1/+17
| | | | | | | | Use the vertical velocity for top and bottom edges, and invert the speed for right and bottom edges. Change-Id: I362dda23f0a2cda60ad7cd52e7373d0707feea83 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Switch: fix Qt::ClickFocus on the indicatorJ-P Nurmi2016-09-021-0/+8
| | | | | | Task-number: QTBUG-55647 Change-Id: Ic89beaa1e6674d3f94c9a713fd9bd8e8fdfafbb6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickDrawerPrivate::handleMouseReleaseEvent()J-P Nurmi2016-09-021-5/+6
| | | | | | | | | | | | | QQuickDrawer operates on scene/window coordinates, se it must use QMouseEvent::windowPos() instead of QMouseEvent::x() or y() which return local coordinates. QMouseEvent::windowPos() is already used in handleMousePressEvent() and handleMouseMoveEvent(). The delta between the press and the release point is used to calculate the velocity. The two points must be specified in the same coordinate space to get correct velocity calculation. Change-Id: Ic9ee904e0b2b022a58b674ee663d8963eb2417a6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup: respect dynamic dim & modal changesJ-P Nurmi2016-09-021-1/+18
| | | | | | | | | | | | | What comes to the visual background dimming, popups did not respect dynamic 'dim' or 'modal' property changes. This was half-intentional, because it was thought an unrealistic use-case to toggle these while the popup is visible. As a result, the background dimming was missing if a popup was made visible in a declarative way, and either 'dim' or 'modal' was evaluated after the popup was already visible. Task-number: QTBUG-54797 Change-Id: Icfb171e619540fef2d91908867b702790cde6c32 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make a plain Container calculate suitable implicit sizeJ-P Nurmi2016-08-313-1/+49
| | | | | | | | | [ChangeLog][Controls][Container] A plain Container 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: I0481aef0ce713d92bee8b119bf5158dea612d598 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make a plain Control calculate suitable implicit sizeJ-P Nurmi2016-08-313-1/+49
| | | | | | | | | [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>
* ScrollIndicator: respect the paddings when overshootingJ-P Nurmi2016-08-301-4/+9
| | | | | | Task-number: QTBUG-55620 Change-Id: I4c06a9e7fefbdbaff7f14a972ed47242c51ca8c6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TabBar: improve the behavior of flickable tabsJ-P Nurmi2016-08-252-2/+13
| | | | | | | | | | | When using flickable tabs, make sure the next or previous tab is a bit visible to make it clear that there are more tabs and ensure that the content is not flickable when there is less content than available size. Change-Id: I231ac8e99007103517ff49e747282af43cc6f8ea Task-number: QTBUG-55129 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix typo in deployment documentationMitch Curtis2016-08-241-1/+1
| | | | | Change-Id: If80bbdc82efed0451c27650d59c2bee5ad44c765 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickStylePlugin: avoid re-creating the proxy themeJ-P Nurmi2016-08-231-0/+5
| | | | | | | | | | | | QQuickStylePlugin::initializeEngine() is called multiple times due to multiple QQmlEngine instances (like in qml2puppet). Don't attempt to re-create the proxy theme on the second round. Thanks to QScopedPointer, the old proxy theme instance was automatically destroyed and thus, the new proxy theme crashed. Task-number: QTBUG-54995 Change-Id: I1648c789df062fdfda54302c77f471139a8de88f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickToolTip: fix the creation context of the shared tooltipJ-P Nurmi2016-08-221-15/+12
| | | | | | | | | | | | | Don't create the shared tooltip in the parent item's context, because that may be destroyed and invalidate all bindings in ToolTip.qml. The QML engine is the effective parent of the shared tooltip, so use the engine's root context for creation as well. We do not need to pass any specific context to QQmlComponent::create(), because it will pick the root context by default. Change-Id: I624b53fa9ba02123398e76b5eccf1a8091826b37 Task-number: QTBUG-55347 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix attached ToolTip propertiesJ-P Nurmi2016-08-191-2/+8
| | | | | | | | | | The attached properties should apply to the shared/global tooltip instance only when the shared tooltip is visible for the attachee item. Task-number: QTBUG-55347 Change-Id: Ia822f2d1de62d2d6dfb28519817edce674d8c2b8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: do not attempt to execute transitions without a windowJ-P Nurmi2016-08-192-3/+9
| | | | | | | | | A parentless/windowless popup item is not associated to a QML engine. Accessing transitions calls qmlExecuteDeferred(), which leads to a crash. This can happen in auto tests with the shared tooltip during destruction. Change-Id: I9a258b2df6b87fce7833e358f17b1910934212c2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Close parentless popupsJ-P Nurmi2016-08-191-0/+2
| | | | | | | | | | | | | | | A parentless popup is not visible anywhere, and is not even associated to a QML engine. Attempting to execute transitions would crash. Make sure to remove any event filters (when using a plain QML Window, like with QML TestCase) when a popup is made parentless. This ensures that if the global shared tooltip was shown on an item that was destroyed, the tooltip won't keep interfering with the window where it was last shown. Change-Id: I87bf9f8dda2fbcc5d1b83d1b83a66a6b9e718eb6 Task-number: QTBUG-55347 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Document that style attributes set in QML have precedence over settingsMitch Curtis2016-08-192-2/+4
| | | | | Change-Id: I88fbebfc672d4c8d398a45b5dfe0c61fa307a9e7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Universal: document the attached style propertiesMitch Curtis2016-08-192-0/+10
| | | | | Change-Id: I390d3f9107f9e38e755f98060f74d63becba60cb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Universal: ensure setting background/foreground worksMitch Curtis2016-08-191-5/+15
| | | | | | | | | | | | | | - Add HasGlobalForeground and HasGlobalBackground. These are set to true when a foreground/background color is specified via settings (qtquickcontrols2.conf file or environment variables), and then used to initialize each attached style object's m_hasForeground and m_hasBackground property. - Add tst_qquickuniversalstyleconf auto test to ensure that global settings are respected. Task-number: QTBUG-55366 Change-Id: I7a8b219506f9528c4ae323bd890b418ba056ed23 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Universal: rename DefaultX variables to GlobalXMitch Curtis2016-08-191-20/+20
| | | | | | | | | For example, DefaultAccent will become GlobalAccent. This better reflects the reality that these are not true defaults because they can be overridden by settings and makes it easier to read the code. Change-Id: I2a7afa3ec8fd6db620d054b6e1f6860b2d3e1d02 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: document the attached style propertiesMitch Curtis2016-08-192-0/+15
| | | | | Change-Id: I8349ec366c75b9480533bb9b61a3748e09e9560e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: ensure setting background/foreground worksMitch Curtis2016-08-191-2/+10
| | | | | | | | | | | | | | - Add hasGlobalForeground and hasGlobalBackground. These are set to true when a foreground/background color is specified via settings (qtquickcontrols2.conf file or environment variables), and then used to initialize each attached style object's m_hasForeground and m_hasBackground property. - Add tst_qquickmaterialstyleconf auto test to ensure that global settings are respected. Change-Id: I436773e355c6d470215fb9cfe8fbff402d2979d9 Task-number: QTBUG-55366 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: rename defaultX variables to globalXMitch Curtis2016-08-191-43/+43
| | | | | | | | | For example, defaultPrimary will become globalPrimary. This better reflects the reality that these are not true defaults because they can be overridden by settings and makes it easier to read the code. Change-Id: Idf09e5b0c6a2d91663730c00e3d32f2be49e15c6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickToolTip: fix destruction of the shared tooltipJ-P Nurmi2016-08-191-1/+12
| | | | | | | | | | | Make the QML engine the parent of the shared tooltip instance, and make sure the instances are per engine. This ensures that the shared tooltip gets properly destructed when the associated QML engine is destructed. The same technique is used for the global styles in QQuickStyleAttached. Change-Id: I08dcb4f9bc6ddafb7449afe43362e560c0952e88 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: don't keep a reference to a destroyed parentJ-P Nurmi2016-08-184-16/+15
| | | | | | | | | | | Move the itemDestroyed() listener from QQuickPopupPositioner, which is only active while the popup is visible, to QQuickPopupPrivate instead. This way the popup gets a notification when the parent gets destroyed while the popup is hidden. Task-number: QTBUG-55347 Change-Id: Ic72206cc05996c23062e814799a030c369fc6288 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: make delegates respect the popup widthJ-P Nurmi2016-08-183-3/+3
| | | | | | Task-number: QTBUG-55050 Change-Id: I25e84d15ebb61f88cc92ab570471969ec5971c10 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate: remove unused QQuickItemChangeListener inheritanceJ-P Nurmi2016-08-181-2/+1
| | | | | Change-Id: I96ebc8ccd0c6bb05a4725cd42a65224411823b82 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* qquickpopup_p.h: add missing override keywordsJ-P Nurmi2016-08-181-4/+4
| | | | | Change-Id: I3ee830e88fd9621ffa4f81b2106c33c06ca7d1e9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add an example how to create a flickable tab barJ-P Nurmi2016-08-113-0/+62
| | | | | | Change-Id: Iad89f8d46b44ca2634d3f8ecd52431654ae5d7ac Task-number: QTBUG-55129 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>