aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* qmldom: Visit call optional token instead of its lparen twiceHEADdevOlivier De Cannière33 hours1-1/+1
| | | | | | | | | | Amends ae6dfc63668556e89057edb1b83de28d7554c5ef Task-number: QTBUG-151040 Pick-to: 6.12 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Change-Id: I438ca1b8e2de4fc05769f2d627c3d7edaefe94a0 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QQmlJSUtils: Accept a relative path in qmlSourcePathFromBuildPath()Jeff Heller37 hours1-3/+4
| | | | | | | | | | | | | | | | | | qmlSourcePathFromBuildPath() found the module through a clean absolute form of the path, then cut the module's absolute directory off the path as passed in. qmllint passes the linted file's path as given on its command line, so linting a build-folder copy by a relative path with --resource read past the end of the string and crashed, for example: cd build && qmllint --resource .qt/rcc/qmake_Mod.qrc \ --resource .qt/rcc/Mod_raw_qml_0.qrc Mod/Main.qml Cut the module directory off the clean absolute path instead. Pick-to: 6.12 Assisted-by: Claude Code Change-Id: I92c078e7c45274b1eeb61c648d64514430cee817 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Support negative radius for inverted corners on PathRectangleXavier BESSON46 hours3-41/+89
| | | | | | | | | A negative radius (or per-corner radius) now produces a concave, "inverted" corner instead of the usual convex one, for both the Rounded and Squircle corner shapes. Change-Id: I258871293d7c42ea890692ad3c6ce17253312480 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* qmlformat: Don't add extra commas to holed arraysOlivier De Cannière3 days2-5/+10
| | | | | | | | | | | | | | | | | | | | `[1, 2, 3, 4, , ,]` is parsed with the comma that comes before the trailing holes stored on two different nodes: on the ArrayPattern, and on the list element that wraps those holes. The formatter wrote both, so every pass over the file appended another hole to the array. That changes the semantics of the expression. Store the comma on the ArrayPattern only if it isn't already part of the elision. This also ensures missing spaces between commas in the array. Amends d41f97e86702d8c5ac81a4246e1aab8dd965cbe4 Task-number: QTBUG-151040 Pick-to: 6.12 Change-Id: Ied05c0100210b0b2d06cf69a4fe55ee565239730 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Parser: Cleanup AST token kindsOlivier De Cannière3 days2-13/+4
| | | | | | | | | | | | Rename Expression to CommaExpression and Module to ESModule to better express their purpose. Remove unused kinds. Task-number: QTBUG-151040 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Change-Id: Icebd15cc791a4b39ceb3de62d53583a769fda4a7 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* qmlformat: Write the comma of each hole of an array, not the first one'sOlivier De Cannière3 days1-2/+2
| | | | | | | Task-number: QTBUG-151040 Pick-to: 6.12 6.8 Change-Id: I57586956dff6f83dfc947c1bd23eac5391b710d7 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Doc: Clarify TableView sorting property behavior at run-timeDilek Akcay3 days1-1/+11
| | | | | | | | | | | Add a note to sortColumn and sortOrder explaining that sortByColumn() should be preferred when setting both at run-time, to avoid sorting the model twice. Also link sortColumn/sortOrder from sortByColumn()'s documentation. Change-Id: I035fb83d8293932ff596bdd33195d3d48016cfe9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* StyleKit: Implement VerticalHeaderView and VerticalHeaderViewDelegateDilek Akcay3 days12-46/+175
| | | | | | Pick-to: 6.12 Change-Id: I3344b3f8f078ae50284486cb7db5e750943f3133 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* qmldom: Remove CommentInfo::commentContent()Olivier De Cannière4 days1-5/+0
| | | | | | | | | | | It is unused. Amends 52d61e705ee606f3b673c757bdf253bdf6134a3b Task-number: QTBUG-151040 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Change-Id: I1c2ae8b1e2dadf50b8ff2d4021eb4e7029e5de94 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QmlCompiler: Restructure result handlingUlf Hermann4 days1-18/+21
| | | | | | | | | | gcc 14 has a well-known bug that causes false positive warnings when move-assigning std::variant and std::optional. Here, we don't actually need to do that, though. Handling the result in a dedicated lambda is nicer anyway. Change-Id: I8fb41d870e5391c21ff99e92c8b85784965cfd78 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* remove QQmlLSUtils::baseObject()Sami Shalayel4 days2-42/+0
| | | | | | | | The function is unused now, remove the implementation and the tests. Task-number: QTBUG-150842 Change-Id: Id80d4e05e2e0c7070bcc057794dd194486091aad Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlLSUtils: rewrite findTypeDefinitionOf logic with QQmlJSScopeSami Shalayel4 days1-94/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can use the information from the QQmlJSScope instead of the DOM importing code for findTypeDefinitionOf, so rewrite it with QQmlJSScope. This might allow a future commit to get rid of the DOM importing and type resolution code which only seems to be used in QQmlLSUtils. Adapt the test, as the QQmlJSScope information is a bit different, for example instead of returning the location for 'C', we return the location of 'Item' when jumping to an inline component like: component C: Item { ... } I believe the small difference of location won't affect the user too much. Remove the functionality and the test for the "go-to-type-definition" on a method name that goes to the type definition of the return type, which is not really intuitive. Adapt the tst_qmlls_modules tests to expect the new location end ranges, for example we return the location of the `Item` on line 3 instead of returning the entire location from line 3 to 10 of the Item in Zzz.qml Task-number: QTBUG-150842 Change-Id: I3659921f04518b5e02338e57676b1010b996c8b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlJSUtils: find build paths of renamed filesSami Shalayel4 days1-3/+1
| | | | | | | | | | Follow the alias in the qrc to also find renamed files. Fixes: QTBUG-150919 Pick-to: 6.12 6.11 Change-Id: I7e8da3beefeefe732c2ad92b74a58e88d794777e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Reject file URLs that can't be represented as local filesUlf Hermann4 days2-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since qtbase's 88e3ceb05106d69746fb9d0528b4c4f8df417e9a, QUrl::toLocalFile() returns a null string if the fully decoded path would contain a NUL or a percent-encoded directory separator (%2F, or %5C on Windows). The type loader passed that empty file name on to isResource(), which asserted when trying to read its first character. Fail the load with a proper error instead. Adapt the Loader tests that relied on %2F being decoded into a directory separator, and fix the url documentation example that encoded a whole path with encodeURIComponent(). Amend the documentation for percent-encoded characters in URLs to highlight the problem. [ChangeLog][QtQml][Important Behavior Changes] Local file URLs whose paths contain a percent-encoded slash (%2F), a percent-encoded NUL (%00), or, on Windows, a percent-encoded backslash (%5C) cannot be loaded anymore. Previously such a %2F was decoded into a directory separator after URL resolution and normalization had already happened. Therefore, "%2F..%2F" sequences could escape a directory that a URL had been checked to be contained in. As specified in RFC 3986 and in ECMA-262's URI handling functions, a percent-encoded slash represents a literal "/" character inside a path segment, not a delimiter. encodeURIComponent() is meant to be used on individual URL components, and decodeURI() deliberately does not decode %2F. A literal "/" can't be part of a file name, so such URLs don't denote any local file. Chromium rejects such file URLs for the same reason. If you build file URLs from paths in JavaScript, apply encodeURIComponent() to each path segment separately, not to the whole path. Pick-to: 6.12 6.8 Fixes: QTBUG-150898 Change-Id: I0ba5158f7ccab4f57850f4a5524dab051c6e9287 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* VectorImage: Allow override of generator choice, for testingEirik Aavitsland4 days2-3/+7
| | | | | | | | | | | | | | | VectorImage uses either the QML Generator or Item Generator as backend; settable on application level. For baseline testing, it is useful to set the choice on individual VectorImage items. Implement this through a special custom property. As a driveby, add a checkered background image to the qmlscenegrabber, which may be used in test scenes. Pick-to: 6.12 Task-number: QTBUG-150931 Change-Id: I557c6f359d3874d4c86205be92a6083d3622413a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QtQml: Throw a ReferenceError when reading a name from a lost objectUlf Hermann4 days1-16/+19
| | | | | | | | | | | | | | | | | | | | Once the QML scope object or the context object is gone, a name that was found on it is not defined anymore. The uncached QML context lookup throws a ReferenceError then, and so does the code qmlcachegen generates. The cached QML context lookups for properties and methods of the scope object and the context object, however, silently yielded undefined, and the function went on. Therefore, a function compiled by qmlcachegen behaved differently from the same function run by the interpreter or the JIT once the lookup had been cached: The compiled function aborted while the interpreted one continued with undefined and caused whatever side effects came after. Throw the ReferenceError from the cached lookups, too. Pick-to: 6.12 6.8 Change-Id: I755e04c2158abf0c2a3e234564722155ba583d9f Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* iOS: Refer to the delegate by id from its backgroundUlf Hermann4 days2-14/+18
| | | | | | | | | | | | | | | | | | The backgrounds of the ComboBox and SearchField delegates read the delegate's properties unqualified, through the delegate's context. When the model is cleared, the delegate model releases the delegates and clears their context object first. The count change that follows still updates the delegates' own isSingleItem, isFirstItem and isLastItem properties, which in turn re-evaluates the backgrounds' bindings. Those can't find the names anymore then. Depending on whether the lookups were cached before, they either throw a ReferenceError or read undefined. Qualify the accesses with the delegate's id. The id stays valid until the delegate is actually deleted. Pick-to: 6.12 6.8 Change-Id: Id7e87d332f795135963e1c0465b3e43260d56479 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* StyleKit: Implement TableViewDelegateDilek Akcay4 days11-45/+205
| | | | | | Pick-to: 6.12 Change-Id: I09f75b8eab46ae5b640eec8b0d4c51ec45ecfbdb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Documentation: Fix inconsistent section levels in class descriptionsFriedemann Kleint4 days4-9/+8
| | | | | | | | They cause warnings when generating Qt for Python documentation. Pick-to: 6.12 Change-Id: If09df5b2523b3097ed9ce9253d46b3f4cf5ce60c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* ScrollBar: don't jump the content when the content size is re-estimatedVladimir Belyavsky4 days2-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | A view with delegates of varying sizes keeps correcting its contentHeight estimate while the handle is being dragged, which changes the mapping from the ScrollBar's position to contentY. offset, the distance between the handle and the pointer, was taken once in handlePress() and never recalculated, so the content jumped against the direction of the drag after every correction. Recalculate offset whenever something other than the drag moves the handle or changes the size while it is pressed. An attached Flickable writes the drag's own position back through visibleArea, so such a write is recognised by value: a position equal to the current one has moved the handle nowhere. The handle may still move and resize as the estimate is refined, which is expected; only the content is kept following the pointer. [ChangeLog][Controls][ScrollBar] Dragging the handle of a ScrollBar that is attached to a view whose delegates vary in size no longer makes the content jump as the view refines its content size estimate. Task-number: QTBUG-130890 Pick-to: 6.12 Change-Id: I62447df8c43051896dc71f61263295f8a5acb7ac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Quick: Fix crash when a section item outlives its contextDenis Letov4 days1-0/+4
| | | | | | | | | | | | | | | | | | | A ListView section item can outlive its creation context, for example when the model is reset while the view is being laid out, or when the view is being torn down while a contentY animation is still running. The next call to setSectionHelper() then dereferences a null QQmlContext: QQmlContextData::get(nullptr) reads QQmlContextPrivate at offset 8, which crashes with an access violation. Skip the update when the context is null The section may keep its outdated label until it is released and a new section item is created with a valid context Fixes: QTBUG-130819 Pick-to: 6.8 6.12 Change-Id: I8be5b3073fdceda878014cf5c1cf136778691270 Reviewed-by: SanthoshKumar Selvaraj <santhosh.kumar.selvaraj@qt.io>
* StyleKit, delayButton: draw the progress as a thin line at the bottomRichard Moe Gustavsen4 days1-4/+5
| | | | | | | | | | | | | | | | | | | | The built-in Qt Quick Controls styles draw the DelayButton progress as a thin line along the bottom edge of the button. The StyleKit fallback style, and the example styles, instead let the progress fill the whole background, which ends up looking out of place - especially for styles such as Vitrum. This patch changes the fallback style to give the indicator a fixed height and bottom alignment, so that the progress is drawn as a thin line, using the accent color as foreground. The example styles are adjusted on top of that, and mostly only need to tweak the height, margins and colors. Plain can drop its delayButton section altogether and use the fallback appearance as-is. Pick-to: 6.12 Change-Id: I5ccc984e2e55e778f8c8ac42019d69d5a1db02d4 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Dilek Akcay <dilek.akcay@qt.io>
* TreeViewDelegate: give tree items an accessible nameLorn Potter4 days5-0/+30
| | | | | | | | | | | | | | | | | | The TreeViewDelegate styles show the display role in a Label and leave the text property empty, so a tree item had no accessible name. Now that accessibility focus follows the current cell, VoiceOver on macOS announced each item as just "text", because the bridge maps ListItem to a static text element. Name the delegate after the display role and ignore its Label, so an item is read neither as empty text nor twice. This covers the Basic, Fusion, iOS and Material styles, and the native style that the macOS style uses. This patch and its commit message were developed together with Claude Change-Id: Ie7136e943e0eec9a8954a06750aaf36ea383bfa3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* quickvectorimage: fix timeline references in the item generatorKwanghyo Park4 days3-116/+132
| | | | | | | | | | | | | The item generator passed the animation provider individual members rather than the objects holding them, so the provider could not tell which timeline a node or an animation belonged to and had to use whichever scope happened to be current. Pass the owning objects, so that the reference travels with the data. Task-number: QTBUG-147709 Change-Id: I6a256027e8dd8ccf1b53b33b8c2c690071cab64a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* TableView: follow the current cell with accessibility focusLorn Potter4 days7-0/+136
| | | | | | | | | | | | | | | | | | | | | | | Keyboard navigation moves the current cell of a TableView, but screen readers did not follow it. TableView is not an accessible item, and its cell delegates do not take focus while navigating (only the edit delegate does, while editing), so assistive technology never saw a focus event. Send a focus event for the delegate of the current cell while the view has active focus, also when that delegate is only loaded after the current index changed, and again when an edit ends and focus returns to the view. Add QAccessibleQuickTableView, whose focusChild() returns that same delegate, for platforms such as macOS that ask the window for the focused element rather than act on the event. Name the Basic TableViewDelegate after the display role and ignore its Label, so a cell is read neither as empty text nor twice. This patch and its commit message were developed together with Claude Change-Id: Id42e994ad470abe8d4b0af4a7cc8e4c5611677e7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* StyleKitProperties: give pointSize a non-zero default sizeRichard Moe Gustavsen4 days1-1/+1
| | | | | | | | | | | | | Text elements write out a warning if the pointSize is set to 0. And when using StyleKit, this can happen if the property is evaluated before the Style and Theme has finished loading (and then it will be corrected). To avoid such a warning, return the default pointSize until the Style and Theme is ready. Pick-to: 6.12 Change-Id: I1fd5db7e350cbdc1ddcd5e1ee53db90e94941c4f Reviewed-by: Doris Verria <doris.verria@qt.io>
* V4: Keep the accumulator intact across the JIT's SetLookupUlf Hermann4 days1-2/+3
| | | | | | | | | | | | | SetLookupSloppy and SetLookupStrict return nothing, but the JIT retrieved their result into the accumulator. The accumulator then held whatever the call happened to leave in the return register, and the next instruction that stored it into the frame exposed that garbage to the garbage collector. Restore the accumulator after the call instead, like the interpreter and StoreProperty do. Pick-to: 6.12 6.8 Change-Id: Ibd4a48543367208ad9cb886fd740c637e7d41961 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix QtQuick.Particles Emitter.InfiniteLifeBernd Weimer4 days2-3/+10
| | | | | | | | | | | | | | | | There were two issues: 1) QQuickParticleData::lifeSpan was assumed to be in milliseconds (like the user facing Emitter.lifeSpan property), though it is in seconds. 2) Infinite particles are kept alive in prepareRecyler() by periodically calling extendLife(), which advances the particles virtual birth time in CPU memory. However, this was never propagated to the GPU vertex buffer. Fixes: QTBUG-121913 Pick-to: 6.12 Change-Id: Icd9124d597a6a8b14cad4da6446f92fc1cd5392e Reviewed-by: Thomas Senyk <thomas.senyk@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Handle the dragged item being destroyed during a native dragShawn Rutledge4 days2-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drag.dragType: Drag.Automatic goes through QDrag::exec(), which blocks in a nested event loop. Anything happening inside that loop can destroy the item the Drag attached object belongs to -- a ListView recycling the delegate that is being dragged is enough, which is what auto-scrolling during a drag does. Both the QQuickDragAttached and the QDrag are QObject children of that item, so they are deleted with it, and every line after exec() in startDrag() then runs on freed memory: the reported crash is in the dragFinished() emission. ~QQuickItem notifies its change listeners before ~QObject deletes its children, so that is the last point at which the drag can still be wound down by an object that is still alive. Listen for Destroyed for the duration of a native drag and do it from there: cancel the platform drag, which unwinds the nested loop and delivers the drag leave that the drop target is waiting for, then report the drag as finished and inactive. Guard the QDrag and the attached object itself across exec() for whatever gets there first. Nothing here knows about item views, so it covers TableView, PathView, Repeater and plain delegate models as well, and any route to the item's destruction rather than only recycling. It does not try to keep the item alive; an application that wants the drag to survive can still use ListView.delayRemove: Drag.active. The new test drives the nested event loop, which needs a QPlatformDrag that runs in-process. It therefore runs on the offscreen platform, and skips if that platform's drag implementation is a stub. Fixes: QTBUG-124663 Pick-to: 6.12 Change-Id: I51c6719bcc9ea0e381a314f68f2f335caa96e616 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QV4::Moth: suppress -Wframe-larger-than in dumpBytecode()Marc Mutz5 days1-0/+3
| | | | | | | | | | The code uses computed goto and other such weirdness, so it's unclear how it can be shrunk. Suppress the warning, to be able to make progress on the rest of Qt. Pick-to: 6.12 6.8 Change-Id: Ibaefc299cca9a22a02e92c65087c2053a8aaecae Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQStyleKitTheme: Keep the font resolve mask when merging font scopesDoris Verria5 days1-2/+11
| | | | | | | | | | | | | | QFont::resolve() returns only the left-hand operand's resolve mask, unlike QPalette::resolve() which ORs both, so each step of the fallback chain in updateThemeFonts() collapsed the accumulated mask down to the nearest layer's. Setting fonts.system.bold in a theme therefore produced a font still holding the style's family and pointSize as values, but with a mask claiming only Weight. To fix, set the resolve mask to the union explicitly. Pick-to: 6.12 Change-Id: Ib802a8ce3d8a5760bc9639631080a25d5e2658df Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QStyleKitStyle: Clear injected widget fonts when switching themes/stylesDoris Verria5 days1-3/+2
| | | | | | | | | | | | | | | | | | | | | A font property defined in a theme or style persisted to some widgets even after switching to a different theme/style. This was because unsetStyleFont() reverted against QWidget::font() whose resolve mask also covers inherited attributes. Since when switching style/theme we walk QWidgetPrivate::allWidgets in no specified order, a widget can be reverted while its ancestor carries the old font, so those bits get written backs as a locally set font so next time setStyleFont() is called, it captures them as baseline font. To fix, use QWidgetPrivate::localFont instead which has the direct font resolve mask. While at it, remove the check in setStyleFont() which guarded setFont() on QFont::operator==, which ignores the resolve mask, making the widget's mask depend on whether the values happened to coincide. setFont() already no-ops when the the font is unchanged. Pick-to: 6.12 Change-Id: I2c249dc4a02e3b957b5b490a7da600432787c2a2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QStyleKitStyle: Size indicators and foregrounds independentlyDoris Verria5 days2-34/+6
| | | | | | | | | Follow what the Quick side already does and don't include foreground sizing and margins when determining indicator size. Pick-to: 6.12 Change-Id: I7a264ee297c89513674fa858834b69c65985d747 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QStyleKitStyle: Support "qrc:" and "file:" pathsDoris Verria5 days1-6/+8
| | | | | | | | | | | | | QStyleKitStyle supported only ":" paths in the local file system. However, adding support for "qrc:" paths as well allows passing the path to a style file in a compiled QML module, speeding up startup time. Therefore add support for this schemes to not limit users that want compiled QML. For symmetry, since we now are supporting qrc: paths, support "file:" paths too. Pick-to: 6.12 Change-Id: I0c58c5e09a9c514a6e48a54c7dd65c70b22c79ee Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Expose 4 QScreen properties to QMLAlbert Astals Cid5 days2-2/+88
| | | | | | | Task-number: QTBUG-147270 Change-Id: I33c6fc8cc823c1e15fa0451ad1b213aa4471f39e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QQuickItemView: don't leave dangling entries in unrequestedItemsVladimir Belyavsky6 days1-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b0b1c1de68a1cc15f6304bb85d0c57a49499f866 ("QQuickItemView: register Destroyed listener when storing an item") added a loop at the end of ~QQuickItemView that walks unrequestedItems and dereferences the stored raw pointers to remove our Destroyed listener from each item. This is only safe while every entry points at a live item. The listener is what keeps that true: when the item is deleted, it calls itemDestroyed(), which removes the entry from the hash. releaseItem() can break that invariant. An item stored with isClearing == false gets both the entry and the listener. Releasing it again while the view is being cleared (isClearing == true) removes the listener but leaves the entry, so itemDestroyed() never runs for it and the entry is never dropped. Once the item is freed, the destructor loop dereferences a dangling pointer, causing a use-after-free crash. For instance, deactivating a Loader that hosts a ListView invalidates the delegate contexts synchronously while the deferred delete is still pending: the delegate ends up in unrequestedItems, and its currentItem/visibleItems twin is released again during clear(true). Remove the entry from unrequestedItems whenever the listener is removed, keeping the two in sync so the destructor never walks a freed pointer. Fixes: QTBUG-150769 Pick-to: 6.12 Change-Id: Ide32473f3fea373749197c969eaff6d13869c32d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Add missing qtquick documentation dependency to fix warningsDavid Boddie6 days1-1/+1
| | | | | Change-Id: Ie46e7a85634e13d888fe3808f4ef5f08493b1c9c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix bug when reading qtdf files with multiple texturesEskil Abrahamsen Blomfeldt6 days1-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | If the pre-generated distance field cache spans multiple textures, then the bottom most glyphs will expand beyond what is reported as the maximum texture size, due to a hot fix made for QTBUG-76528. When fixing QTBUG-149508, a stronger restriction was added on the glyph rects, ensuring that they do not expand beyond the texture. This was to protect against malformed qtdf tables and the main purpose was to keep the values from overflowing into negative numbers. Checking the height against maxSize * 2 instead ensures that we also accept glyphs that expand beyond the texture size while keeping the fix for QTBUG-149508 for any reasonable texture size. This adds tests for both QTBUG-149508 and QTBUG-150766 to ensure both problems are covered. Fixes: QTBUG-150766 Change-Id: I59e793b6bee32f83999f597c92275ddbdba1bd38 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit c2a8d0ff939122a5c1e8e6c5c59dae53c7b30389)
* StyleKit: Implement TumblerDilek Akcay6 days10-1/+123
| | | | | | Pick-to: 6.12 Change-Id: I5d846bbe13babc1001d12a1230513cc59fca6f8f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickAbstractButton: fix mnemonics not being stripped on macOSMitch Curtis6 days4-17/+10
| | | | | | | | | | | | | | | | | | | | | | 474a84312a06c427dee4e248bb85ac2c460a3a71 intended to disable mnemonics for macOS. However, it defaulted QQuickMnemonicLabel::m_mnemonicEnabled (and QQuickIconLabel::m_mnemonicEnabled, which just forwards it to QQuickMnemonicLabel) to QPlatformTheme::MnemonicsEnabled, which is false for macOS. The property's value controls whether the & is removed or not: if true, it is removed, but whether it's underlined is still controlled by QPlatformTheme::UnderlineShortcut. If false, the & is kept. This patch fixes the issue by simply defaulting m_mnemonicEnabled to true, and leaving it up to ItemDelegate and derived types to set it to false. Fix the test so that it actually tests this, as before it was relying on the platform theme hint. Task-number: QTBUG-73087 Change-Id: I176d167116958296fb5d8e6777048d6203018a4e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQmlSortFilterProxyModel: fix assert when queried without a sourceModelMitch Curtis8 days1-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | rowCount() and columnCount() guarded against a missing source model with !d->model. Since 74eeda555f569b6ddd2f5f0937fbff80591db143 ("Use sourceModel property in the QML SFPM instead of model"), that is QAbstractProxyModelPrivate::model, which holds QAbstractItemModelPrivate::staticEmptyModel() rather than nullptr when no source is set, so the guard never triggered. create_mapping() checks sourceModel(), which does return nullptr for the empty model, and asserts. index(), headerData(), setHeaderData(), insertRows(), insertColumns(), removeRows() and removeColumns() had no guard at all, so they hit the same assert. Check sourceModel() in all of them. Add tests for querying a proxy that has no source, and for a proxy whose source is another proxy that has no source of its own. Fixes: QTBUG-150555 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Change-Id: Ia05a32337e718389f20d7be90d381883252342d5 Reviewed-by: SanthoshKumar Selvaraj <santhosh.kumar.selvaraj@qt.io>
* qmltyperegistrar: only warn for lowercase classnames, not namespacesFrederik Gladhorn8 days1-2/+3
| | | | | | | | | | Types in a namespace are fine, as long as they are uppercase. Completes 0b6d25e0213c0d1831faf0d9bb54bade6a3145c2 which introduced the warning. Pick-to: 6.12 6.11 Change-Id: I576b9382366a743fd45e37c08b845fc062df3cdf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove the synthetic mouse move that reset hover after a touch releaseShawn Rutledge9 days1-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fd70c80fe1cac83776cc4730555c8e3dea930c1c made deliverTouchAsMouse() send an extra QEvent::MouseMove back to the cursor position on synth-mouse release elsewhere, so that MouseArea::mouseMoveEvent() would recompute containsMouse and drop the hover. It was a hack: it invents an event that no device produced, it only works for items that do not accept touch events, and its condition depends on whether the platform happens to drag the cursor to the touch point - which is why it is a no-op on Windows but load-bearing on X11 and Wayland. QTBUG-61938 and QTBUG-68970 were regressions filed against it, both making the same point: converting touch to mouse is fine, inserting extra events in between is not. The previous commit clears fingertip hover directly, and MouseArea resets containsMouse itself on a fingertip release, so the synthetic move has nothing left to do - it was only ever a roundabout way of reaching setHovered(false), and it reached it for just one of the three types that needed it. This is a deliberate behavior change for anything that relied on receiving that MouseMove: it is gone, and hover is now ended with a QEvent::HoverLeave instead, which is what an item would have gotten from a real cursor leaving it. Pick-to: 6.12 Task-number: QTBUG-62912 Task-number: QTBUG-40856 Fixes: QTBUG-61938 Fixes: QTBUG-68970 Change-Id: I322973c3065eaa6de331d51a8b407bb23e65f9b5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* qmlpreview: Don't try to compile .(m)js files as QMLUlf Hermann9 days1-1/+7
| | | | | | | | | | | We need to evict them from the cache on reload, but we shouldn't re-compile them right away. That can be done on-demand the next time they're requested. Pick-to: 6.12 Fixes: QTBUG-150558 Change-Id: Ia339ee0f9ab110c3517a4c06cf150cfa99110246 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QtQml: Keep dependency-less bindings alive while previewingUlf Hermann9 days3-2/+11
| | | | | | | | | | | | | | | | | The object creator drops bindings that have no dependencies after their first evaluation since their values cannot change anymore. The QML preview, however, changes their code. With the binding gone, there is nothing to re-evaluate when patching in place, and the edit is silently ignored. For example, changing "duration: Math.abs(1000)" of a running animation to "duration: Math.abs(100)" had no effect. Keep such bindings alive if the preview is active. Pick-to: 6.12 Fixes: QTBUG-150561 Change-Id: I1cfcb0c3b778499d7173a4485bccbcd309f25f27 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* StyleKit: Implement DrawerDilek Akcay9 days10-0/+92
| | | | | | Pick-to: 6.12 Change-Id: Ia2662a993a563b4ff5f518a71e6e34bf85dab93f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Replace another call to QSvgNode::document()Robert Löhning9 days1-1/+3
| | | | | | | | | | | | | | It was slow and should be removed altogether. All other calls were already replaced in b10cd4252550b7471b264b83e8ffaa7b07f67613, but while that was still being prepared, cbdacc91486bbaad2b66669ed7cd69020f68e1ab, introduced another one. Pick-to: 6.12 Change-Id: I2577a97546e4ce7cec37e82c0d56987a3f6364e5 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* qmlpreview: do not reload all files constantlyFrederik Gladhorn9 days2-1/+10
| | | | | | | | | | The logic to reload a file would actually trigger a reload of all files. In a real application of a slightly bigger size that slows down things a lot. It triggered rebuilding the entire type registry. Pick-to: 6.12 Change-Id: Ie484c3514d066b7950f79f4b5bba77a33d2b5213 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* macOS: Use QCocoaWindow native interface for trackpad touch deliveryTor Arne Vestbø9 days1-9/+6
| | | | | | | | | | | | Toggling trackpad touch delivery through the string-based nativeResourceFunctionForIntegration() lookup ("registertouchwindow") has been superseded by a typed enableTrackpadTouchDelivery() function on the QCocoaWindow native interface. Use that directly, instead of resolving an untyped function pointer from the platform plugin. Pick-to: 6.12 Change-Id: I07b978416b72b952b86ff4dfcd2d307954aa51df Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* V4: Fix more TDZ bugs around (destructured) assignmentsOlivier De Cannière10 days3-6/+40
| | | | | | | | | | | | | | | | | | | | | | | Now properly throws when trying to access variables before their initialization in more situations like function () { x = 1; }() let x; or for ([ x ] of [[]]) {} let x; or 0, [ x ] = []; let x; Task-number: QTBUG-108362 Pick-to: 6.12 Assisted-by: Claude Code Change-Id: I530976b3c72c36c153832fa45f2c7011873987f2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>