aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
Commit message (Collapse)AuthorAgeFilesLines
* Register C++ types declarativelyMitch Curtis2020-08-2662-334/+558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt to the new way of registering C++ types. The types need to be seen at compile time so that code can be generated that invokes them. This patch: - Adds QML_* macros where applicable. - Adapts the build system files to the new way of registering modules. - Splits up the QtQuick.Controls[.*].impl files into their own plugins, as we can only register one QML module per .pro file. - Removes C++ type registration calls in every plugin. - Moves private types from src/quickcontrols2/quickcontrols2.pro to src/quickcontrols2/impl/quickcontrols2-impl.pro. Some of these types need to be exposed to QML, but quickcontrols2.pro is already in use to declare the QtQuick.Controls import (and also provides the public C++ QQuickStyle API), and the new QML_IMPORT_NAME/VERSION syntax only allows one module per project. As some of the types that need to be exposed to QML are also referenced by some C++ code (e.g. tests, etc.), we just move all of the private types to the new library. Follow-up patches will register the QML types declaratively. Task-number: QTBUG-82922 Change-Id: Iaf9ee106237d61701d57a8896f3822304c8151a6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickSpinBox: fix another "function expressions as statements" warningMitch Curtis2020-08-201-1/+1
| | | | | | | | | | This amends d5fbbddd7794265f24d392d33c4874ac756cb9c9 by also fixing valueFromText(). Task-number: QTBUG-64151 Pick-to: 5.15 Change-Id: I02b053bb4d4579e86eaaa2279826f3b103800fdf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Document that pop() does nothing if depth is less than or equal to 1Mitch Curtis2020-08-201-0/+3
| | | | | | | | | | This note is already in the detailed description, but users looking at pop() can easily miss that. Pick-to: 5.15 5.12 Task-number: QTBUG-85903 Change-Id: I92c71c8d98b2a83aefbc99229e5b16a6fb33b937 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* SwipeDelegate: don't allow calling close() when pressedMitch Curtis2020-08-191-0/+5
| | | | | | | | | | This conflicts with the behavior of SwipeDelegate. The released() or clicked() signals should be used instead. Fixes: QTBUG-85804 Pick-to: 5.15 Change-Id: I06111b63941f54c06f0e1b828d17264f37d765d5 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* SwipeDelegate: don't emit closed() when already closedMitch Curtis2020-08-191-1/+5
| | | | | | | | | | If the mouse is released while our position is 0, it means we were clicked, and we don't need to begin any transitions to close. Fixes: QTBUG-85806 Pick-to: 5.15 Change-Id: Ic521f48e2977c1a99dbecaa585792a7798b9d749 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Prevent against re-entering prepareExitTransition after a focus changeAndy Shaw2020-08-191-1/+1
| | | | | | | | | | | | | | | | | When a popup is hidden, then it will trigger a prepareExitTransition which can cause the active focus to be lost. If the popup's visibility is tied to that fact then it can retrigger the transition which means the active focus does not go back to where it should. Therefore, we check if hadActiveFocusBeforeExitTransition is false before going through that process as then it will only be called the first time the popup is hidden. Pick-to: 5.15 Fixes: QTBUG-85884 Change-Id: I68054aeb48447617b4235ce6467514a17f1073ba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Get the scale of the popup item when setting the parent itemAndy Shaw2020-08-172-8/+11
| | | | | | | | | | | As there are some styles that will do an transition which animates the scale then we need to size and position based on the final scale it will have to avoid a jump after it has finished the transition. Pick-to: 5.15 Fixes: QTBUG-84488 Change-Id: I4571eb18c921e81de319838ac0e8d3fe3513d438 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix event refactoring warnings and errorsMitch Curtis2020-08-119-44/+44
| | | | | Change-Id: I426b4f75066c9db72759398e4d76fd5323044d57 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* ComboBox: add implicitContentWidthPolicyMitch Curtis2020-07-162-3/+192
| | | | | | | | | | | [ChangeLog][Controls][ComboBox] Added implicitContentWidthPolicy, which controls how the implicitContentWidth of the ComboBox is calculated. This can be used to automatically ensure that text is not elided. Fixes: QTBUG-78281 Change-Id: If669fa4ef05e5da498992843469000ef39c335ec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: mention cache property in the relevant placesMitch Curtis2020-07-152-0/+2
| | | | | | | | This was missed in 033564edf5b79e32da63597930e25105a3442f01. Pick-to: 5.15 Change-Id: I7bc465338d5b9960ad7b746a816cd33efcca1bdc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix crash on exit when centering Popup within Overlay in StackView itemMitch Curtis2020-07-142-1/+31
| | | | | | | | | | | If a Popup is centered within an Overlay, and that Overlay is destroyed before the Popup, we must make sure centerIn is cleared so we don't try to access a dangling pointer. Fixes: QTBUG-84579 Pick-to: 5.15 5.12 Change-Id: Icb2750f847f9d5710725bedc4d1c92bf4c122c03 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVectorJarek Kobus2020-07-092-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: I4991ab7ce8ba8d2522005b1b0a78f7b474c54419 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-306-14/+14
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I92ef02ede041d3965151165a479a1ea0549cc0f9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQuickSplitHandleAttached: pass correct d ptr to QObject constructorMitch Curtis2020-06-251-1/+1
| | | | | | | | Not sure how this ever worked, but the tests have been passing, so... Pick-to: 5.15 Change-Id: I6afecc692d56e5e58687cf5b60e87510275ec2b1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix warnings after deprecation of QApplication::keyboardModifiersVolker Hilsheimer2020-06-251-2/+5
| | | | | | | | Use QInputEvent::modifiers where possible, disable warnings otherwise. Change-Id: Ifcb4ff4395e4a3eb1e6cce24e169b628346769be Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-1111-44/+44
| | | | | | | | | | | | | | | | | | | | Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtquickcontrols2 $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I7fb9b0603341ea1a0c3a00f79ebd642a6354702d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-098-16/+16
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic36741d2bcaec8d5e5dc96638b7122f8ce51bdb2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ApplicationWindow: remove deprecated overlay APIMitch Curtis2020-06-083-83/+0
| | | | | | | | | | [ChangeLog][Controls][ApplicationWindow] The deprecated overlay properties and attached API were removed. Use the Overlay attached type instead. Task-number: QTBUG-84715 Change-Id: I0781ea55ea502ffe5277385e82492291724d2090 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickStackView: deprecate Transition enum valueMitch Curtis2020-06-082-6/+9
| | | | | | | | | | | | | | | | | | | | bc86a96c56934d98d641844319a905753f56895a added a comment that this was deprecated, but didn't document it as deprecated or have any mention of it being deprecated besides that one comment. As we are dynamically evaluating the JS arguments in C++, we don't need to have a "default" enum value; we can detect omission of the argument and act accordingly. It's now too late to deprecate it for Qt 5, but we can do it for Qt 6. [ChangeLog][Controls][StackView] The StackView.Transition enum value was deprecated. The operation argument can be omitted in order to use the default transition for any given operation. Task-number: QTBUG-84715 Change-Id: I530235beb2ebf56deb6f82ab54e269322e92a0a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* CMake: Regenerate configure.cmake filesAlexandru Croitor2020-06-041-2/+6
| | | | | | | This will show the usual configure summary reports. Change-Id: I38dcbbed8e20e382be5c4271e2d6f90de100d180 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QQuickTextArea: resize background different when inside FlickableRichard Moe Gustavsen2020-06-021-2/+11
| | | | | | | | | | | | When a TextArea is placed inside a Flickable (using the TextArea.flickable property), the background is reparented to the Flickable. For this to look good, the background should have the same size as the Flicable as well, so it doesn't end up with the size of the TextArea, which can be many pages tall. Pick-to: 5.15 Change-Id: I75ead02c712f337c7e743f17aa8810a040519173 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: fix heap-use-after-free when pushing after clearMitch Curtis2020-05-293-14/+32
| | | | | | | | | | | | | This patch extends the work done in aaec25a7 to cover all operations. Note also that b94889f4 does a similar thing to this patch and aaec25a7, in that it explicitly ignores operations that are done during the removal of elements. Fixes: QTBUG-84381 Pick-to: 5.15 Change-Id: Id8bbbded39d8e58bcf0e8eedeb2dde794952333f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add missing overrideAlexander Volkov2020-05-251-1/+1
| | | | | | Pick-to: 5.15 Change-Id: I29af6f91ed90395ce3fdb92081d54a17f16d58e0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Listen for the LanguageChange event in event() instead of using filtersAndy Shaw2020-05-192-21/+7
| | | | | | | | | | Now that the LanguageChange event is sent to all top level windows to pass on down to items then we can drop the event filter and just listen for it in the event() function. Pick-to: 5.15 Change-Id: I6c9699a798680695ea1d0013266d3a034b74ae7b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: fix currentValue not being updated on model changesMitch Curtis2020-05-121-6/+6
| | | | | | | | | Make sure we call updateCurrentValue() where necessary. Fixes: QTBUG-83554 Pick-to: 5.15 Change-Id: Iad593c2fc094a26429de1eda91bbdb152ffee2c2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Menu: remove deprecated removeItem(var) overloadMitch Curtis2020-05-112-19/+1
| | | | | | | | | [ChangeLog][Controls][Menu] The deprecated removeItem(var) function was removed. removeItem(Item) or takeItem(int) can be used instead. Change-Id: I79757c22b4f81e1b380798623bd1f15eb09c1647 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix -no-accessibility buildPeter Varga2020-05-112-0/+4
| | | | | | Change-Id: Icbae79fd0f48fb9351ee8cc12b35ead7e99b09e2 Pick-to: 5.15 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Container: remove deprecated removeItem(var) overloadMitch Curtis2020-05-113-20/+2
| | | | | | | | | [ChangeLog][Controls][Container] The deprecated removeItem(var) function was removed. removeItem(Item) or takeItem(int) can be used instead. Change-Id: Ibc693a9216cd039fc11cb4e5182f74a96f493796 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* ComboBox: make pressed read-onlyMitch Curtis2020-05-112-1/+2
| | | | | | | | | | This was planned for Qt 6. [ChangeLog][Controls][ComboBox] The pressed property is now read-only. The down property can be used instead. Change-Id: Ie241a420ac228207b3f564af66d3eb3738f6a145 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* HeaderView: always use headerdata from syncView modelRichard Moe Gustavsen2020-05-051-7/+2
| | | | | | | | | | | | | | | | | | | When HeaderView has a syncView, it should always use the header data of the syncView as model, and not only when that model is an QAbstractTableModel. Otherwise you cannot use headerView together width models like e.g QFileSystemModel (which is a QAbstractItemModel). If HeaderView has a syncView, but its model doesn't contain header data, then just leave the header empty. The application must either assign an model explicit to HeaderView, or provide header data to the syncView model. Just transposing the model will just duplicate the data in the syncView, which looks wrong. Pick-to: 5.15 Change-Id: Ie48e960be8bf9fdd3ed227d90c6efb6aabfd18b5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Adapt to geometryChanged => geometryChange renamingMitch Curtis2020-04-2434-51/+51
| | | | | | Task-number: QTBUG-82994 Change-Id: Iaf530d2a6f4dc92641d0c10e16e7b931f90646ac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: explain how to allow Menu to move outside of the window via marginsMitch Curtis2020-04-211-0/+8
| | | | | | | Task-number: QTBUG-82279 Change-Id: Ibc9bae71995f140882dd0f636ff360af8ac0337c Pick-to: 5.15 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix build with latest QHash from qtbaseMitch Curtis2020-04-171-10/+8
| | | | | | | This is the same as what was done for 13ede1b9 in qtdeclarative. Change-Id: I00c7a066954efde0e569d24c267e734c31829c5b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-314-10/+31
|\ | | | | | | Change-Id: Ie09cfdd17b00e56f3ba8677d25b24417dd4e42f6
| * HeaderView: Add support for list based modelsAndy Shaw2020-03-242-3/+23
| | | | | | | | | | Change-Id: I411136bd2b9a277d84a7c68c55bb1c317b6cc9d2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-212-7/+8
| |\ | | | | | | | | | Change-Id: I9ecddc7a68da4f15ee2c2904e237496eb6a2aa26
| | * Menu: account for the scale when getting the size before positioningAndy Shaw2020-03-182-7/+8
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-73687 Change-Id: Id2d6a6b5c6651337ab7ae26d07011160b79654bf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Update dependencies on 'dev' in qt/qtquickcontrols2Qt Submodule Update Bot2020-03-233-8/+8
| | | | | | | | | | | | | | | | | | | | | Fix build after internal QtQml API changes. Change-Id: Iaeafb84f5f2d9c60b54659f27e7baa448a858c4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: Regenerate projects after changesAlexandru Croitor2020-03-201-2/+0
| | | | | | | | | | | | | | | | | | | | | Amends 31f5c21ddb571d744efd1885c0687816b3a12225 Change-Id: I870de5ce096b13b24f58f5cbef9cd701286916dd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove the remaining usages of QRegExp and QRegExpValidatorLars Knoll2020-03-191-10/+10
| | | | | | | | | | | | | | | Change-Id: Iab8e682eeb43b3403eba37f7decb7f7a494ae361 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix build after QJSValue API changesSimon Hausmann2020-03-191-2/+2
| | | | | | | | | | | | | | | Change-Id: I21ba3fc72951b946e84eb8c7c85f73ff4276eaac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Remove old QQuickPalette implementationVitaly Fanaskov2020-03-1882-1576/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementation was removed in order to reduce massive code duplication and simplify color resolving process. Unit tests were fixed accordingly. See related changes in the qtdeclarative module for the further details. [ChangeLog][General] the palette API is a part of QQuickItem now. Change-Id: Ic94ab4632e626c11d9b26f035e2a8a119c9088ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-182-14/+39
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-182-14/+39
| |\| | | | | | | | | | | | | | Change-Id: I88990095b97a4088f9fda6c9496fd69d4556f6a1
| | * | SplitView: fix hidden items causing visible items to not be resizableMitch Curtis2020-03-132-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a handle is dragged, the items on either side of it are resized. Until this patch, we were assuming that the item after the one at the handle index was visible, which was wrong. Now we iterate through each item after the one at the pressed index until we find one that's visible. Since we need this in a few other places during a handle drag, we cache it as a member variable. This patch also fixes an issue where the visibility of handles were not updated after setting a new handle delegate. Change-Id: Icd246abae2ed4dc6c3b81217b9a241b7e4debf7d Fixes: QTBUG-81867 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | CMake: Regenerate projectswip/cmakeAlexandru Croitor2020-03-172-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-1774-183/+1195
|\| | | | | | | | | | | | | | | Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
| * | | Fix build failures as a result of QMetaType changes in qtbaseAlexandru Croitor2020-03-1210-0/+21
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | moc now stores the QMetaType of properties as a result of 46f407126ef3e94d59254012cdc34d6a4ad2faf2 in qtbase, which requires full type information about the property type inside the moc generated source file. Many of the property types were forward-declared, and this resulted in build errors like "invalid application of 'sizeof' to an incomplete type 'QQuickTransition'" Make sure to explicitly include the moc files inside the counterpart .cpp files, so that full information is available from included headers. Fixes: QTBUG-82774 Change-Id: I5971713864992398daed72ce9f6ab866668cf8e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Update the current text after a translator is installedMitch Curtis2020-03-052-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures that if the model is updated due to a retranslate that it gets the updated string and the ComboBox shows it correctly. Change-Id: Iecbc18a1051d6db13035b3efa393d9bf97788dd9 Fixes: QTBUG-82020 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15v5.15.0-beta1Qt Forward Merge Bot2020-02-223-4/+19
| |\| | | | | | | | | | Change-Id: Iff02839c8ace49582750e06fa1ea9c559f6c93fe