aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* QtQml: Unify the lists of types and propertyCachesUlf Hermann7 days3-32/+33
| | | | | | | | Each type has a number of propertyCaches. There's no need to keep them in separate lists. Change-Id: I62fd7a07ce56bc258c06df8efcbbf972143e3fd2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QmlPreview: Don't give up when positioning a window at (0, 0)Ulf Hermann7 days1-4/+0
| | | | | | | | | | That's a perfectly fine place to position a window. Pick-to: 6.11 6.10 6.8 Task-number: QTBUG-142436 Change-Id: Ief27328f428ecbe54f57b79dd7408f55eba1d965 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* StyleKit: reimplement broken QQStyleKitDebug::propertyPath()Richard Moe Gustavsen8 days4-33/+58
| | | | | | | | | | | | | | | | | | | | | | | | QQStyleKitDebug previously printed property paths under the assumption that nested property groups followed the same parent–child hierarchy as they are written in the style. After a recent optimization in QQStyleKitPropertyGroup, this assumption is no longer valid. As part of that optimization, all property groups now have the root QQStyleKitControlProperties as their parent in order to avoid unnecessary hierarchy traversals. This change broke the logic used to reconstruct property paths for debugging. This patch introduces QQStyleKitPropertyGroup::pathToString(), which reconstructs a property path in the same order as it is written in the style. While this functionality may also enable future optimizations, it is currently used to restore correct and readable debug output. Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: I60e0aac3320c703b5b0995daa5a68a8ea1f015c5 Reviewed-by: Doris Verria <doris.verria@qt.io>
* Fix assert when destroying qqmltypeloaderthreadEven Oscar Andersen8 days1-0/+2
| | | | | | | | | | | | | | | The stub implementation of shutdown that is used if !QT_CONFIG(qml_type_loader_thread) does nothing. Hence in this case the thread is running. Apparently the processing is event based in this case so this should not be a problem. Fix by only doing the assert for !running() if QT_CONFIG(qml_type_loader_thread). Change-Id: I93b4f75ce4a1babdb836d28a9cd5f75ef2b3cf54 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* VectorImage: Support CSS easing curvesHatem ElKharashy8 days2-1/+43
| | | | | | | | | | | | Supports linear and any cubic bezier based easing curves supported by Qt Svg. For the current time being, whenever the easing curve is set to a step function in Qt Svg, we revert to the default value which is the "ease" keyword in CSS. Pick-to: 6.11 Task-number: QTBUG-142333 Change-Id: Ifb6b3a2dfe955b5a247399e201efe0d7877bf235 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QtQml: Eliminate controversial obtainCompilationUnit() callUlf Hermann8 days1-24/+15
| | | | | | | | We can deduce that this inline component type is either a self-reference or has a typeData. Change-Id: If04183079c88b30a4e651b21318987a3c0f464b0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Drop the interfaces container from QQmlMetaTypeDataUlf Hermann8 days2-6/+2
| | | | | | | We have this information already in the QQmlType itself. Change-Id: If8d40b6b79eb65dcf30057db9828795b30d4b5c6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Re-order QQmlTypeData::TypeReference and ScriptReferenceUlf Hermann8 days1-7/+6
| | | | | | | | | | This drops the size from 72 bytes to 48 byes on x86_64. We have a lot of type references. ScriptReference stays the same size, but the padding moves to the end. Pick-to: 6.11 Change-Id: Iab377ea1e5cec983a32c9c2d80369f624e3c8fa9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Do not load resolved CompilationUnits from other enginesUlf Hermann8 days4-46/+11
| | | | | | | | | | | | | | | | | | | | | If the type loader doesn't have a QQmlDataBlob in its cache, then this engine hasn't ever loaded and resolved the respective compilation unit. We can't skip the type resolution then because the current engine may have different URL interceptors, import paths, plugin paths etc than the one that previously loaded the CU. This leads to different type resolutions. This should not re-open QTBUG-134398 since now the base compilation units are not shared between engines anymore, despite still being stored in the type registry. Amends commit 27c2c989a3d10557da15de3d45bb5bd7b96d14e8. Amends commit 6468df7657f6af4de8727363c7f7d97b680b1867. Pick-to: 6.11 6.10 6.8 Fixes: QTBUG-142658 Change-Id: I10139492c38b4a943ecca41928ec96097cd8bfbe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Docs: fix various linksVolker Hilsheimer8 days4-8/+10
| | | | | | | | | Use the correct syntax for the scope of the link target for Qt Quick types. Pick-to: 6.11 Change-Id: Ica96c1b736a9b8ddd29a63c21d6a7094bd598ed8 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* TableView: fix initial topRow/bottomRow/leftColumn/rightColumn signalsMiika Pernu8 days1-1/+1
| | | | | | | | | | Property changed signals weren't correctly emitted due to comparison against old values that were incorrect. When constructing the view for the first time, the properties have initial value of -1 and not 0. Fixes: QTBUG-142067 Change-Id: I86bde8abd65e6f135a9f03f35913da914d762d26 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QtQml: Make metaObjectToType constUlf Hermann10 days4-6/+6
| | | | | | | Nobody needs to modify QQmlTypePrivate once it's created. Change-Id: I8c28cf1ce64852576df671e663f9d00b419e3350 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QtQml: Fix sorting in CMakeLists.txtUlf Hermann10 days1-2/+2
| | | | | | Change-Id: I2ff9533f262deb906d359c25c02d31fa8e95c9ff Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* StyleKit, optimization: track which properties a style/theme storesRichard Moe Gustavsen11 days4-19/+68
| | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an optimization that allows the propagation engine to skip checking a style/theme/variation if it does not store a value for the property being queried. This significantly reduces the number of QHash lookups needed during property resolution. For example, when resolving all property values for a Button in the hovered state, the number of “failed” lookups dropped from 1632 to 168 when tested with the Haze style. The large improvement is likely due to the typical separation of concerns between styles and themes (at least in Haze): styles primarily define structural properties such as implicit size and corner radii, while themes define colors. Additionally, many properties in the Fallback style remain untouched by both style and theme. Under such conditions, which should be common, this optimization becomes highly effective. Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: I25d3e350a70243b8e5f96b08f9217a3404866572 Reviewed-by: Doris Verria <doris.verria@qt.io>
* StyleKit: use QHash instead of QMapRichard Moe Gustavsen11 days2-2/+2
| | | | | | | | | | | | | It's apparently not only faster, but also more memory efficient to use a QHash. QMap can be better if one needs to iterate over the keys in sorted order. But that is never the case for StyleKit. So switch to use QHash instead of QMap for the affected containers. Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: I6f430acbd32555cba85de8191aefa71140b07111 Reviewed-by: Doris Verria <doris.verria@qt.io>
* Doc: Update flowchart to use CSS styling where possibleDavid Boddie11 days3-1/+216
| | | | | Change-Id: I1630b786a331d65e519e52914377ed5166a0d272 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* VectorImage: Fix compilation after Qt Svg changesHatem ElKharashy11 days2-7/+7
| | | | | | | | | | Qt Svg has renamed QSvgTinyDocument to QSvgDocument. The name now better reflects the implementation and the required changes in Vector Image are done in this commit. Pick-to: 6.11 Change-Id: Ib558cc622b325575e24c9028d98134e4321416f7 Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* StyleKit: remove unused function declarationRichard Moe Gustavsen11 days1-2/+0
| | | | | | | | | Remove left-over and unused function declaration Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: I0f56b9f60905d3474f9804ef39b2541344d4a3d0 Reviewed-by: Doris Verria <doris.verria@qt.io>
* qmltyperegistrar: Store foreign metaObjectHash for QML_FOREIGN typesOlivier De Cannière11 days6-0/+31
| | | | | | | | Amends b0bf54bdb02863bce25764c6e1efc42a03071ef2 Task-number: QTBUG-142186 Change-Id: I0b2b9bf282e374f3f374cda32c0e2096aa0bb14a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4: Mark CompilationUnit::saveToDisk constOlivier De Cannière11 days2-2/+2
| | | | | Change-Id: I6141df5776471aea755d0b57b2015571b250088a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qml: qqmljs.g adjust precedence and associativity of keywordsDmitrii Akshintsev12 days2-9/+14
| | | | | | | | This patch changes resolution of conflicts (dangling "else" and "as" ambiguity) using precedence only relationship, which should be sufficient. Additionally it makes most of the nonassoc keywords equal, instead of erroneous relationship that was there before. Change-Id: I8fea33214221af36021b7d122d6d044a09214309 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Allow GraphicsInfo to be used with a WindowLaszlo Agocs12 days2-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Allow writing Window { property int api: GraphicsInfo.api } instead of having to do Window { property alias api: dummy.api Item { id: dummy property int api: GraphicsInfo.api } } Change to member initialization to avoid duplicating many lines with the existing constructor. Pick-to: 6.11 Change-Id: Ie07247ee8a6ae1b2d3d7245d77e83ece89909729 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Neutralize Qt Quick index pageAndreas Eliasson12 days1-3/+3
| | | | | | | | | Be more explicit about how to use the module in a C++ project. This way, we can add future supported language sections later. Fixes: QTBUG-142009 Change-Id: Iaa300155b0079df6b4fbbd6bfc8e05da94634af8 Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
* Remove hideLine flag from QQuickEllipseShapeAlexey Zerkin12 days3-24/+10
| | | | | | | | | After migration from QML version hideLine flag became useless in EllipseShape Task-number: QTBUG-142557 Pick-to: 6.11 Change-Id: I95b6407908385e4a406a15d3f36d5049e2725314 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Deprecate Qt Labs' DialogMitch Curtis12 days1-0/+1
| | | | | | | | | | | | This was missed in 9a6d405cd639f839752a41b8b95627a9627ab0c7. [ChangeLog][QtLabsPlatform] Dialog is now deprecated. Use QtQuick.Dialogs instead. Task-number: QTBUG-130864 Pick-to: 6.11 Change-Id: I5672d106effc253cc438537023122efb421dffc4 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QmlCompiler: Get length from strings wrapped in QJSPrimitiveValueUlf Hermann13 days1-3/+14
| | | | | | | | | | | | We need to consider the original type of the value in order to see what we can do with it and we need to convert it (back) to string where necessary. Pick-to: 6.11 6.10 Fixes: QTBUG-142550 Change-Id: Ic0eb2c7a22636cfb2d97297421b911555bd32bb1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Doc: Improve documentation for console.exceptionUlf Hermann13 days1-2/+4
| | | | | | | | | | | console.exception() unironically throws an exception if you call it without arguments. Otherwise it's almost the same as console.error() but prints a stack trace in addition. Pick-to: 6.11 6.10 6.8 Fixes: QTBUG-119460 Change-Id: I99cc1c009310059d7bd5bbd8308436b832f41da7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Update docs about constructible value typesUlf Hermann13 days1-21/+5
| | | | | | | | | | | | You shouldn't use type assertions to create value types. That was a terrible idea. We can document the interaction with the 'new' operator now, though. Task-number: QTBUG-124662 Pick-to: 6.11 6.10 6.8 Change-Id: I94dbf47cfd72ef20a2d4758450634708590f8fec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Elias Steurer <i@kelteseth.net>
* Avoid the Shapes gradient texture cache growing without boundsEirik Aavitsland13 days3-32/+77
| | | | | | | | | | | | | | | | | | | | | | | | Nothing was ever removed from the cache, so in case of e.g. an animated gradient, a large number of texture objects would be created and not released, and memory would quickly fill up. Fix by changing the caching implementation with a set maximum number of cached gradient textures. This introduces a soft limit on the supported number of simultaneously displayed different gradients in the application. If exceeded, some objects will show wrong gradient colors. Although unlikely to be reached, the limit is documented and configurable by environment variable. As a driveby, improve the gradient cache key qHash() implementation a bit, presumably giving better spread for the QCache. Fixes: QTBUG-142208 Fixes: QTBUG-136553 Pick-to: 6.11 6.10 6.8 6.5 Change-Id: Ie104f27031572e1c392c0a8ef79d09f4a2ba5a8e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* StyleKit: only emit signals globally for readers of the correct typeRichard Moe Gustavsen13 days11-76/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the application wrote a new value to a property in the style, we used to emit a property changed signal for that property from every StyleKitReader (control) in the application. We did this because we could not easily know which controls would be affected by such a write because of property propagation. This could therefore be very slow. But now that we have more functionallity in StyleKit available, such as being able to resolve a controls base types, we can now improve on this logic. Therefore, this patch will ensure that we instead only emit changes from the StyleKitReaders of the same type (or a base type) as the control written to in the style. The result is that a write from the app, such as: StyleKit.style.groupBox.background.radius = value will cause an update only for groupBoxes, skipping all other controls. This is clearly faster. Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: I6432db93f282b8155d9270a57206f0d558b801a8 Reviewed-by: Doris Verria <doris.verria@qt.io>
* StyleKit: ensure we hide delegates upon setting 'visible: false'Richard Moe Gustavsen13 days1-4/+7
| | | | | | | | | | | | | | | | | | | | | | | As it stood, if you e.g did: control.background.shadow.visible: true control.hovered.background.shadow.visible: false Then the shadow would stay visible also when the control was hovered. The reason was because the shadow was already created in the normal state, and toggling visiblity after that point had no effect. This patch will fix this, so that we hide the shadow if its visibility is set to false after first having been created. We refrain from destroying it again, since doing so has a higher cost, and most likely, the hiding of the shadow is just temporarily. Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: Ib107b11b7f7fa638d7ac439348b9ccb75bf1bb1a Reviewed-by: Doris Verria <doris.verria@qt.io>
* quickshapes: Fix Unity buildFriedemann Kleint13 days1-0/+2
| | | | | | | | | | | Amends a783420505f1b68f2b8a4333d516bfa51bfb2a47. Task-number: QTBUG-141530 Task-number: QTBUG-115140 Pick-to: 6.11 Change-Id: Iab7c6bf19e1180b9a146ceb6d0b25b5234613ca9 Reviewed-by: Alexey Zerkin <alexey.zerkin@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Qt.createQmlObject: Trim compilation unitsFabian Kosmale13 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | When we call createQmlObject, a completely new compilation unit is created. If an object is stil in use, that compilation is obviously needed. However, if code is using createQmlObject repeatedly with the same URL, there's a good chance that the object was only temporarily needed. To avoid unbounded memory usage in that case, we call trimCompilationUnitsForUrl, to remove the no longer needed CUs. Note that this does not help if the URL is also changing dynamically, but we don't want to trim all caches, including ones the user might actually want to hold on. To handle such cases, we should rather 1. integrate the trimming logic with the gc 2. give it a separate, configurable "high water mark" 3. Use some proper caching system for CUs, e.g. LRU That is however out of scope for this commit. Pick-to: 6.11 6.10 6.8 Fixes: QTBUG-142555 Change-Id: I7ebb63abd9bb99531b6b6b2cf1f98b35b1e652e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Remove stale version information from Qt Quick ControlsAlexei Cazacov13 days11-109/+120
| | | | | | | Fixes: QTBUG-141045 Pick-to: 6.11 6.10 Change-Id: Ieb8882f4f07c0893095481e7f9104069cf92a389 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* VectorImage: Parse contents in separate QML contextEskil Abrahamsen Blomfeldt13 days2-1/+5
| | | | | | | | | The generated QML does not need access to the VectorImage's context, since it is self-contained. Pick-to: 6.10 6.11 Change-Id: I61b12aaf5c3abcfe4c21057a28f46f9d85c2054a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid create offscreen surface when using custom rhi deviceJiDe Zhang2025-12-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | When QQuickRenderControl is used for multi-threaded rendering with a GLES backend, a warning "Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures." may be emitted. This warning occurs when an QOffscreenSurface is created even though the QQuickWindow already has a custom RHI (Rendering Hardware Interface) graphics device explicitly configured. Creating an additional offscreen surface in this specific context is redundant and can lead to the aforementioned warning, especially given the multi-threaded nature. This change introduces a check to detect if the QQuickWindow is already utilizing a custom RHI graphics device. If a custom RHI device is present, the creation of the general QOffscreenSurface is skipped. This prevents the warning and potential resource conflicts, ensuring QQuickRenderControl operates correctly when an RHI-specific graphics device is already in use, without unnecessary surface allocations. Pick-to: 6.11 Change-Id: I343dff445ad320ab120c71764d756126bf0ce133 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* StyleKit: don't bind to the palette from the Fallback styleRichard Moe Gustavsen2025-12-091-137/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to bind several of the colors in the Fallback style the palette. This turns out to be not such a good idea. The reason is that the palette differs across platforms, which means that a style created on e.g macOS can end up looking completly different when running on Ubuntu. While this might be wanted sometimes, more often it has the potential to come as a surprise at a late stage during development, and contributes to a "write once, debug everywhere" scenario. This patch will therefore change this. We now choose to follow the Basic style approach, and "hard-code" the colors in the Fallback style to be the same on all platforms. This gives developers a stable platform to build their own styles on top of. It's still fully possible to bind all colors in their own style to the palette, if they want a more dynamic style that respects the platform palette. Task-number: QTBUG-130067 Pick-to: 6.11 Change-Id: Ibeeedacb35b5a4c68c827b66baf0298a42b2948a Reviewed-by: Doris Verria <doris.verria@qt.io>
* VectorImage: Escape quotes in font familiesEskil Abrahamsen Blomfeldt2025-12-092-5/+10
| | | | | | | | | | | | Loading SVG files that use font families with quotes will produce invalid output that does not parse correctly. When outputting the font family, we have to escape the quotes first. In addition, any character in the font family has to be valid HTML when we output it into a style tag. Pick-to: 6.8 6.10 6.11 Change-Id: If25b3cfd3a537d7f7c8c65045deece1ad02b43c3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: Sanitize source string used in outputEskil Abrahamsen Blomfeldt2025-12-091-3/+22
| | | | | | | | | | | | | Source string is used as object name in output, so we sanitize it to make sure it does not contain illegal characters. SVG already mandates a limited character set here, but rather than trust the parser we sanitize before passing to the generator like the Lottie visitor does. Fixes: QTBUG-142556 Pick-to: 6.8 6.10 6.11 Change-Id: I0684e726ab69a0735dcb5f91369b090d58a90b7b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQmlJSAnnotation: de-inline op== and qHash()Marc Mutz2025-12-092-28/+37
| | | | | | | | | | | | | | | | Way too much is going on in these functions to have them as inlines. Presumably, op== "looked" simple (but QHash equality is anything but...), and qHash() was inline because of the defaulted seed argument. Use overloading instead. The type doesn't seem to be used outside its own module, so there's no need to export the out-of-line functions. Amends d226e24a5d4288a3e7f263c526cb6cbf72255388. Pick-to: 6.11 6.10 6.8 6.5 Change-Id: Ib9641001a590fd1482ec463afd48003b7759e2f8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix documentation syntaxNicolas Fella2025-12-091-2/+2
| | | | | | Pick-to: 6.11 6.10 6.9 Change-Id: I3da95e29f642224067307a64450b80154c10cb82 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Neutralize 'Best Practices for QML and Qt Quick' pageAndreas Eliasson2025-12-081-15/+15
| | | | | | | | | | | | | | | | Re-write in such a way that there's room for other backend languages to be included on the page. * Re-write introductory section about separating UI logic from business logic, replacing C++ references with the more general "strongly typed language". * Keep section "Exposing Data from C++ to QML" as it's still valuable. Fixes: QTBUG-142007 Pick-to: 6.10 Change-Id: Icb94d354ad3b2bf913c202e74174aee7c31036b4 Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
* Improve easingCurve value type documentationHatem ElKharashy2025-12-082-13/+7
| | | | | | | | | - Reference the structured value type page. - Fix errors in snippet and text. Change-Id: I16eeb0f8c2d9d9d3f36ea0d0fe34087b7330a9c4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update default values for {Ellipse,Star,Rectangle,RegularPolygon}ShapeAlexey Zerkin2025-12-064-10/+13
| | | | | | | | | Set the same width, height, fillColor, strokeColor and strokeWidth values for rectangle, star, ellipse and regular polygon shapes Task-number: QTBUG-142450 Change-Id: I1920d22e80944ee4f220b927b4c1fcbbe2bb077a Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
* StyleKit Example: improve the example after recent StyleKit fixesRichard Moe Gustavsen2025-12-061-1/+1
| | | | | Change-Id: I01bcdaea8a7014c3bd2f1c65b7d00a048700b91f Reviewed-by: Doris Verria <doris.verria@qt.io>
* Windows style: override the application palette when in dark modeVolker Hilsheimer2025-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native Windows (XP) styling code cannot render controls in the dark color scheme. Our code detects that the application is running in dark mode, and then explicitly creates a light palette that gets set on the QQuickTheme singleton. However, the palette that the style is actually using isn't always based on the QQuickTheme palette, so we get inconsistent colors: the window background is dark, a button font is light, while the button itself is also light. This makes the UI unusable. QGuiApp has no knowledge of Qt Quick's styling infrastructure, or of QQuickTheme, so it cannot ask the style to "polish" the palette like we do in widgets. As a quick fix, override the global QGuiApplication palette with the light palette. [ChangeLog][Controls] The Windows native style will use a light palette as the application global palette on Windows systems running in dark mode. The style cannot render dark controls, and mixing a dark application palette with some UI elements rendered in light mode using the Control style results in inconsistent and unusable user interfaces. For Dark mode UIs, use a style that supports dark mode, like the FluentWinUI3 or Fusion styles. Pick-to: 6.10 6.8 Change-Id: I5e279b88ba018baa03936624e07f48e8986eb1c6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* qmlls: use resource files from CMake for the DOMSami Shalayel2025-12-056-21/+76
| | | | | | | | | | | | We can use the resource files from the .qmlls.build.ini also when constructing the DOM, instead of iterating over the build and import folders. Fix and rename a test in tst_qmldomitem. Task-number: QTBUG-141707 Change-Id: I9dcbd4cd307aba251e5de1d8c00c97b22dd87eb4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmlls: read resource files from .qmlls.build.ini filesSami Shalayel2025-12-056-1/+32
| | | | | | | | | | | | | | | | | We can't find resource files by iterating on the build folder without causing QTBUG-141707, therefore implement reading resource files from the .qmlls.build.ini files. A later commit will make CMake add the resource file information in the generated .qmlls.build.ini files. A separate commit will take care of usages of resourceFilesFromBuildFolders() in the dom. Keep a fallback for projects without resource files, for example projects targeting qt < 6.11. Task-number: QTBUG-141707 Change-Id: I279d193aa6a2849526c2f56c6a40e83492050f74 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmlls: don't use build directories as import pathsSami Shalayel2025-12-053-24/+11
| | | | | | | | | | | | | | | | | | | | Don't mix build and import paths in qmlls. Use build paths for build path operation (finding .qmlls.build.ini, eventually resource files, CMake invocations, ...) and the import paths for imports (when linting and constructing the DOM). Only use build paths as import paths as a fallback, for projects running on Qt < 6.10. It turns out that our tests were making heavy use of "build folders are import paths". Modernize the tst_qmlls_modules tests to write a .qmlls.build.ini file in the build folder which contains the import paths. Also don't read the import path twice from the qmlls.build.ini file, and read it from the QQmlCodeModelManager, not the QQmlCodeModel. Add a test for importPathsForFileUrl() that used to duplicate the import paths. Task-number: QTBUG-141707 Change-Id: I9eceb743bf37bc0f743954a0e7b1e5831f1989fa Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Optimize fallback lookups a bitUlf Hermann2025-12-052-39/+42
| | | | | | | | | | We don't need to repeatedly query the metaobject for its properties just to determine the type. We can instead store the type right away. The same holds for the "resettable" flag. Task-number: QTBUG-142331 Change-Id: Ia8bb96587a344a2981e766e4bc2f13bcac7b4561 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>