aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickvectorimage
Commit message (Collapse)AuthorAgeFilesLines
...
* qquicktransformgroup: change transitive include to an explicit oneFabian Kosmale2025-05-221-0/+1
| | | | | Change-Id: I702ddfa549a7fadee423628f576dfff4083448a7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Android: fix comparison of different signed integersRami Potinkara2025-05-201-1/+1
| | | | | | | | | | This patch fixes the comparison of different signed integers on Android x86 architecture. Fix introduces q20::cmp_greater_equal to be used. Fixes: QTBUG-136969 Change-Id: I6ec17c3604b82266cfd7a68f7f5505360b6a65c6 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Avoid redundant property Animation stepsEirik Aavitsland2025-05-201-97/+111
| | | | | | | | | Animation steps that do not actually modify the property value are replaced with just a PauseAnimation. Significantly reduces the number of lines in the output. Change-Id: I281acb123e664ed21e63c5a94ac65dc30e4de1fa Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support replace animationsEskil Abrahamsen Blomfeldt2025-05-196-175/+414
| | | | | | | | | | | | | SVG has a feature where a set of animations on the transform can be set to either replace or append to previous animations, but only while the animation set is active. In order to support this, we introduce a helper class called TransformGroup which can contain a set of parallel animations and have them override the others. Change-Id: I28be7d120527b1f2d1e3dbf5c5de94094c766363 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: Support transform referencesEirik Aavitsland2025-05-165-27/+157
| | | | | | | | | | | | The Lottie file format has a feature where a layer can have the transform of another layer (including any transform set on one of its ancestors) as its base. This means that we need a specialized helper type that collects the transforms of its ancestors and exposes the combination so that it can be referenced from a different part of the generated QML. Change-Id: I20b72cb9b9af2834f40f391ecb8df7bb0c5e1958 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support items that are visible for specific durationsEskil Abrahamsen Blomfeldt2025-05-162-20/+36
| | | | | | | | | This is a feature in Lottie, where layers pop into existence and pop out later on. We do this by animating the visibility of the item. Change-Id: Ieebab4e84f9254976b0de9759a1f0f4c8026210e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add API to VectorImage for controlling animationsEskil Abrahamsen Blomfeldt2025-05-146-29/+214
| | | | | | | | | | | | | | | | | | | | | A lot of animations will just be a single time line that you is intended to be controlled from the outside (and formats like Lottie does not support anything beyond this), so we need some API to match the general Animation API so that you can restart, pause/resume and change the number of times an animation loops. We do this by adding a group of properties called "animations" that can be used to control all the animations in the document at once. We generate this both in the QML file from *toqml and also in VectorImage itself. [ChangeLog][QtQuickVectorImage] Added some API to the VectorImage for looping, stopping, pausing and resuming animations. Fixes: QTBUG-135265 Change-Id: Id372c00110d165d02db357ce77eb1dec504cffb8 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add path trimming to quick vector graphics generatorsEirik Aavitsland2025-05-132-0/+22
| | | | | Change-Id: I8364e33cb2bffd528e73c1fd1e46fa8b3663e951 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support fill-opacity and stroke-opacity in VectorImageEskil Abrahamsen Blomfeldt2025-04-307-9/+232
| | | | | | | | | | | | | | | | | | | | The alpha value of the fill and stroke colors can be animated separately in SVG. In order to support this, we introduce a specialized ColorOpacityAnimation type in a Helpers library which only overwrites the alpha channel of the target property. This requires an extra hook in the animation frame work which allows us to get the current value of the property. It should have minimal impact on any existing code, but may have additional use cases later, when we implement support for additive color animations for instance. Since the interpolator API in QVariantAnimation is public API, we add a secondary, private API for this. If we see use for it in the future, this could mature to a public API as well. Fixes: QTBUG-135322 Change-Id: I803f4e64c41e9d6dc355f2468233661885aa7f15 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Adapt to refactor of transform anims in Qt SvgEskil Abrahamsen Blomfeldt2025-04-292-42/+88
| | | | | | | | | In order to correctly support transformation order, we needed a refactor in Qt Svg. We need to adapt to this and apply the animations in the correct order in Qt Quick. Change-Id: I38e323f95b7edc26fd8d78ebd98778c3da1adbea Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* QQuickItemGenerator: Add missing includes/forward declarationsFabian Kosmale2025-04-162-0/+2
| | | | | Change-Id: I957b800ce4fca00f846ae5c567e84b72b6fc0401 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* qml: remove unused headerZhao Yuhang2025-04-131-1/+0
| | | | | | | These headers don't use std::pair at all. Change-Id: I1c5c5974949ada2e05151e238884ce4f12156b5f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Port away from QPairZhao Yuhang2025-04-123-3/+3
| | | | | | | | QPair is just an alias of std::pair anyway. Task-number: QTBUG-115841 Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Implement item generator via QML generatorEskil Abrahamsen Blomfeldt2025-04-115-715/+62
| | | | | | | | | | | | | | | | | We were spending time doing the same implementation twice, since the item generator and QML generator were two separate code paths. We also risked having bugs which only occurred in one of the code paths. This may at some point be a valid optimization, but during development it is premature. The parsing of the QML is a one-time cost when loading the SVG and this is an acceptable cost for now. Optimizations can come later when we have a more stable state. Fixes: QTBUG-135269 Change-Id: I649a89d7a2e18ef1c0213658dc106f2cc1194841 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQuickAnimatedProperty: Add missing includeFabian Kosmale2025-04-101-0/+1
| | | | | Change-Id: I35a01ad834ad701be8c99334dc4ee5063eac0ce8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Port transform animations to animated property systemEskil Abrahamsen Blomfeldt2025-04-107-498/+386
| | | | | | | | | | | | | | | Move away from the complex attempt at creating a single animation out of the key frames and instead pass each animation into Qt Quick. While this will fix some things, it may also regress for some cases of overlapping conflicting animations since we now just depend on the Qt Quick behavior there. If we see the need to support these cases, then we probably need a special ParallelAnimation type that allows modifying how the changes are applied based on which animations are active. Change-Id: I0c0ff867cd5917b19318ebe241a1ab8a9c1c8156 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Animate opacity propertyEskil Abrahamsen Blomfeldt2025-04-104-22/+18
| | | | | | | | Use the new generalized animations to implement support for opacity animations. Change-Id: Id758942d383f71b08ffc514fa5341e13194deaca Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* Change the way we do color animationsEskil Abrahamsen Blomfeldt2025-04-049-201/+378
| | | | | | | | | | | | | | | | | | | | | | | | We need a generalized way of doing animations to simplify adding animations for other properties. In order to be as expressive as possible we need to just pass the animation info on to the generator and let it handle it. If there are multiple animations affecting the same property at the same time, we just instantiate them in Qt Quick and let its engine handle the conflict. This means that the only way to implement special SMIL conflict behavior such as add/replace is to create specialized animation classes in Qt Quick. We can do this at a later stage if it becomes a priority. The main use case of having multiple animations affecting a property at different times should be covered by this implementation, it should be easy to expand to new types, and it should be easy to add stuff like easing curves to it. Change-Id: I927ea2cef214a300ae8fae3f76ee87fb5d505b3d Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* vectorimage: Fix possible QML error with miterlimitEskil Abrahamsen Blomfeldt2025-04-041-2/+2
| | | | | | | | | | | | | The miterLimit in Qt Quick Shapes is an int, so if we generate fractional numbers in the QML file, that will lead to a parser error. This was reproducible by running svgtoqml on paint-stroke-07-t.svg. Pick-to: 6.8 6.9 Change-Id: Ia03cbba7f70f687dc93ac20b86314dae1fbc30d3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* vectorimage: Fix identical gradient stops in qml generatorEskil Abrahamsen Blomfeldt2025-04-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | In SVG, two subsequent identical gradient stops means a hard transition to the color of the second at that position. However, this is not the case in Qt and because of the way we sort the gradient stops, the order of the two identical stops will be wrong. This is addressed by adding an epsilon to identical stops in Qt Svg, but the epsilon is FLT_EPSILON, which is around 1e-7. The default output precision for doubles in Qt is 6, so when storing the numbers to file, the epsilon would be lost, the two positions would be considered identical and the reordering would happen. This caused a visual error when running svgtoqml on the paint-grad-16-t.svg test. Pick-to: 6.8 6.9 Change-Id: I857958512c3de7dc843a705893b4c2d7d2a36fd4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQuickVectorImage: Do not mark the plugin as mandatoryFabian Kosmale2025-04-011-1/+0
| | | | | | | | | The QML module does nothing fancy in its plugin, so there's no reason to claim that the plugin is mandatory. Pick-to: 6.9 Change-Id: I850c6d74c2c5254df748897cb2987df8a5fccfce Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* vectorimage: Use unhinted font layoutsEskil Abrahamsen Blomfeldt2025-02-272-0/+16
| | | | | | | | | | | | | | | The whole idea of VectorImage is scalable graphics, and a hinted font layout is inherently unscalable, as the glyph positions will be rounded to integers. Therefore, we need to disable hinting on the QFont before creating the layout. This also updates the svg manual test to compile and run again, as it seems to have been broken at some point. Pick-to: 6.8 6.9 Fixes: QTBUG-133852 Change-Id: Idd63a9fcab51c1f077427ea06ad891975ee73386 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: Fix issue with animation ending earlyEskil Abrahamsen Blomfeldt2025-01-161-0/+18
| | | | | | | | | | | | | | | | If a transform animation ends while others are still running, we need to record the state directly after the shorter animation ends, so that we get a key frame for only the animations that are still active as a starting point. Note: This also adds some extra debug output which was helpful when debugging it. Pick-to: 6.9 Fixes: QTBUG-132408 Change-Id: Ied1f4e7431d201f7bcef27eb4be271eb0afbd8f2 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Transform animations for VectorImageEskil Abrahamsen Blomfeldt2024-12-207-29/+720
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This works by first creating a transform object per animated property we have in SVG. Then it creates a set of key frames based on these. All key frames will touch all animations, so that they can also control activating and deactivating an animation, freezing the end result of one, etc. The frames we generate are based on the end points of animations as well as right after (and sometimes right before) the animation to record the state when it is inactive. If any of the animations have infinite repeats, we create a set of key frames for the finite part first and then the infinite loop, so that these are separated into two different animations in QML. At each key frame we check all animations to see if they affect their corresponding transform at this time. If they are inactive, the transform will be set to a default value. But if they are active (either running or frozen), we query the interpolated value from the animator to get the value at the specific time. Pick-to: 6.9 Fixes: QTBUG-127590 Change-Id: I0102cefb3713a0c36661fb3da008b25b19a80427 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* QQuickGenerator: enable Shape items within Shape itemsEirik Aavitsland2024-12-195-25/+24
| | | | | | | Needed for handling hierarchical group structures. Change-Id: I38475f71f4864c79c3b94622362f45ac65e33e86 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Decouple the Quick vector graphics generator from qtsvgEirik Aavitsland2024-11-145-22/+28
| | | | | | | | | | | To allow other usages of QQuickGenerator and related classes, remove (most of) the hardcoding against qtsvg and restructure the api a bit. As a driveby, also ensure that all members in the generator's NodeInfo structs are initialized by default. Change-Id: I731a99422ff03ec7bd0301b124e3b3264c6cc0b7 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* Fix warning in qquickqmlgenerator.cppMate Barany2024-11-061-1/+1
| | | | | | | | MSVC was warning about the concatenation as QTextStream does not have anything against const char[] in QT_NO_CAST_FROM_ASCII mode. Change-Id: Icbdde0c847354729558a263c793f4b28450d84d4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* AnimateColor supportEskil Abrahamsen Blomfeldt2024-10-317-4/+207
| | | | | | | | | This adds support for the color animations currently supported in Qt Svg, for parity. Task-number: QTBUG-127590 Change-Id: I8d996b2842911e03b2c92783114a688754e9b93c Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* Fix compilation against updated Qt Svg moduleEskil Abrahamsen Blomfeldt2024-10-301-1/+2
| | | | | | | | Some enums have been replaced. Change-Id: I75f4830a847f1838adba4669751e15ff238094cf Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* Add missing includesFabian Kosmale2024-10-241-0/+3
| | | | | | | | | | ...in preparation of trimming down includes in QQuickItem. As a drive-by, remove the superfluous qqml.h include from quick/items/qquicktextutil_p.h. Change-Id: I7ee0f459bcbfdfe07314d1f63433aaa8639870ac Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* VectorImage: Fix potential nullptr dereferenceEirik Aavitsland2024-09-061-1/+2
| | | | | | | | | | | The lout pointer was dereferenced right before it was tested for being null. This modifies c25bfd53425894ff12f3f883f3d6c211e9840973 Coverity-Id: 467163 Pick-to: 6.8 Change-Id: I2ebbc2c321971997f8553c8dfcb3f235ffff044c Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* VectorImage: Fix transform of nodes following embedded imagesEskil Abrahamsen Blomfeldt2024-08-312-4/+2
| | | | | | | | | | | | | | The handling of images in the VectorImage generator would apply the node info before setting the new node as current, thus setting transforms on the parent instead. Note: This patch also removes a couple of outdated comments and fixes indent on the QML generator for images. Pick-to: 6.8 Task-number: QTBUG-128476 Change-Id: I1fbcfbac5a97f66ecbff0e74b27c0e2c88cc08f6 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Add \since for new QtQuick.VectorImage moduleKai Köhne2024-08-301-0/+1
| | | | | | | Pick-to: 6.8 Change-Id: I1d920751dbb48944678898245a059360efcaca55 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* VectorImage: Allow root items to be path containersEskil Abrahamsen Blomfeldt2024-08-285-17/+52
| | | | | | | | | | | | | | | | | When the generators were refactored to add special-handling of the root node, the path container logic from the structure node handling was not included there, causing some SVGs to get a lot of Shape items instead of combining them. This re-introduces the logic by adding a Shape item inside the root item if we see that we can make a root path container. (This is slightly different from structure nodes, where the structure node itself can be the Shape item. Since the root node has special requirements, we keep it and just add a new Shape level inside.) Pick-to: 6.8 Fixes: QTBUG-126716 Change-Id: If05fd38bad08749cf5c4b338ead104aa01672e49 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: Implement support for switch controlEskil Abrahamsen Blomfeldt2024-08-132-0/+19
| | | | | | | | | | There is some support for SVG's switch in Qt Svg, so we support the same in VectorImage and svgtoqml. Pick-to: 6.8 Fixes: QTBUG-121645 Change-Id: Ifb90fad3f16337b2a71b48d796dfb0fad82b39b4 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* VectorImage: Fix gradients applied to individual lettersEskil Abrahamsen Blomfeldt2024-08-087-17/+21
| | | | | | | | | | | | | | | | When the gradient is in object mode, it will be adapted to the bounding rect of the path it draws. However, since we are creating paths for each letter individually when doing this for text, we ended up applying the gradient to each letter's bounding box. This patch allows the caller to override the path's bounding rect with a different one, which in the case of text will be the QTextBlock's bounding rect instead. Pick-to: 6.8 Fixes: QTBUG-126235 Change-Id: I65fa994c98d1e13154c2f5aa218ddf0353388a79 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* VectorImage: Allow fewer types to be children of shapesEskil Abrahamsen Blomfeldt2024-08-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | We allowed certain node types to be allowed as children underneath a Shape item. There is no clear reasoning for why these nodes were selected. An issue with making items children of what is actually a sibling is that the z order will no longer be automatically handled, as the shape will be drawn underneath its children. There is no way to merge two shapes into one and ensure that an item wedged between them is placed at the correct z level relative to both. One case which would work is for text when it is drawn using paths, so this is a potential optimization. However, it would require factoring out the logic which detects whether this is needed. Text may not be a common enough use case for this to be worth it. Pick-to: 6.8 Fixes: QTBUG-127656 Change-Id: I7c73535f9298897e1f9e2e4a80814df966f5a501 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: use fillTransform with gradientsHatem ElKharashy2024-07-314-25/+36
| | | | | | | | | | | | If a gradient is using "objectBoundingBox" units, fillTransform in QQuickShapePath is used to apply the correct transformation to user space. This was handled manually in linear gradient and never in radial gradient. Fixes: QTBUG-126232 Pick-to: 6.8 Change-Id: I801eac6d9fbfa9985ff2a04e7c72502edb4fb744 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Update generated assets in weather forecast exampleEskil Abrahamsen Blomfeldt2024-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This have been regenerated with an updated svgtoqml. One change was needed in the example: The generator would previously added a subitem inside the main item which was transformed to fit the item to the requested size: Item { implicitWidth: foo; implicitHeight: bar Item { transform: ... Shape { ... } } } This was since removed, likely because it's dead weight (and removes the possibility of overriding it), so now the transform is set directly on the generated root object. But the weather forecast example had made the map labels children of the generated item, which means the scale was now also applied to them. This was easy to fix in the example, by creating the extra item ourselves in the case where it's needed. This patch also takes the liberty of fixing some minor whitespace issues etc. Pick-to: 6.8 Change-Id: Ic324815c71f990bb7e8e7caed659c14267b1777a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Add inherits field to QQuickVectorImageHatem ElKharashy2024-07-121-0/+1
| | | | | | | | VectorImage QML doc was not showing that it inherits from Item Pick-to: 6.8 Change-Id: Ifa4b57fa567683342fc8e7e1221b55cec4b84cf7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QuickVectorImage: Straighten out some logging categoriesUlf Hermann2024-06-195-8/+3
| | | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: Id75663fcf73244a93ab50c3279e253eede1f475a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* VectorImage: Support gradient strokesEskil Abrahamsen Blomfeldt2024-06-191-7/+54
| | | | | | | | | | If the stroke has a gradient set, we support this by generating a path for the stroke and filling this as any other path. Pick-to: 6.8 Fixes: QTBUG-121648 Change-Id: I203f45d37eb75880392abdf0e58e742542aaf4d9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: fix switch statementsTim Blechmann2024-06-191-0/+2
| | | | | | | | thanks to clang's -Wimplicit-fallthrough Pick-to: 6.8 Change-Id: I8c54a7c91026a74e29abe3b50db932aec779fcd7 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* svgtoqml: add a few minor usability improvementsEirik Aavitsland2024-06-175-8/+11
| | | | | | | | | | | | 1) Implement & document that if an output file is not given, the tool behaves as if the --view option was given. 2) If reading or parsing the input file fails, then avoid creating an empty output file. Also, let the tool exit with an error code. Pick-to: 6.8 Change-Id: Iaeb8cbb61c2c485cfa3ecba0d3193ba7cd4e5b87 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support SVG fonts to some extent in VectorImageEskil Abrahamsen Blomfeldt2024-06-151-13/+223
| | | | | | | | | | | | | | | SVG fonts have some limited support in the Qt Svg QPainter backend. This implements it in VectorImage by introducing a font engine which serves the glyphs. (This solution could be moved into Qt Svg at some point for a more complete support, but the direct use of QRawFont is still limiting, so it would require some more enablers in Qt Gui first. It depends how much usage such a feature would get.) Pick-to: 6.8 Fixes: QTBUG-122116 Change-Id: Ibc3de6e7c1536b3240e087c4b92f172156335b61 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* VectorImage: Add support for gradient/fill transformsEirik Aavitsland2024-06-155-11/+49
| | | | | | | | | | Handle the SVG gradientTransform and patternTransform attributes. Fixes: QTBUG-121661 Pick-to: 6.8 Change-Id: I79d85ebfef46527e2909440aaca94c975bf21a47 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* VectorImage qml generator: Add line continuation optionEirik Aavitsland2024-06-152-70/+24
| | | | | | | | | | | | | | | | | Allow disabling the automatic newline functionality of the internal stream() function, so that the code can add more to the same line. This changes the functionality so that a newline is added immediately by stream(), instead of when the returned temp object is destructed. I.e. now calling stream() starts a new line, except if the SameLine flag is passed. This also allows simplification of the whole streaming code, with fewer intermediate data copies and allocations. Pick-to: 6.8 Change-Id: I567efd96bd2cb86e73212208d5e7f9328251afa3 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* Remove the use of GENERATE_CPP_EXPORTS argumentAlexey Edelev2024-06-111-2/+0
| | | | | | | | | The behavior that argument was enabling is the default one now. Pick-to: 6.8 Task-number: QTBUG-90492 Change-Id: I11711d4c794f0b22169abb595b8ffad2eeb1300d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* VectorImage: Support stroke styling for textHatem ElKharashy2024-06-112-14/+82
| | | | | | | | | | | SVG has several attributes that can control stroke style. Since those are not supported in Text Component, the code that turns text into paths. Pick-to: 6.8 Fixes: QTBUG-124426 Change-Id: I415393618ee0421310a3dd00bff339a17154c76b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* VectorImage: Handle text-anchor properly for textHatem ElKharashy2024-06-111-2/+7
| | | | | | | | | | | text-anchor for texts turned into paths was not handled, which led to incorrect positining the rendered text for "middle" and "end" values. Simply translate the generated QPainterPath by a factor of the text width to position it correctly. Pick-to: 6.8 Change-Id: Ib9d9b82733df631576be86dba165348f687ab3c7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>