aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextnodeengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improve a qHash implementationGiuseppe D'Angelo2020-06-181-2/+2
| | | | | | | Fixup the signature and improve qHashMulti. Change-Id: I701a0f43ff0533269964334767dc220b8fd48188 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix the vertical alignment of images in a text documentDominik Holland2020-06-171-4/+6
| | | | | | | | | | Try to align with the HTML standard as much as possible. AlignMiddle is between AlignTop and AlignBottom. Fixes: QTBUG-84981 Pick-to: 5.15 Change-Id: Ie99aef0d09a6ece751883492748630526c4a1195 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update dependencies on 'dev' in qt/qtdeclarativeQt Submodule Update Bot2020-06-111-3/+1
| | | | | | | | And workaround hash issue for now by using qHashMulti Also, fix test build failure Change-Id: Ia6b696b2531149206c73e7a5a958d7fba74a0f19 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickTextNodeEngine: prevent renderring transparent selection colorWang Chuan2020-06-051-2/+2
| | | | | | | | | | It is not necessary to render selection color which is transparent. Pick-to: 5.15 Fixes: QTBUG-83819 Change-Id: I45c086652e194192619aad025121e6064ab37a58 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Change qHash return value to size_tFabian Kosmale2020-04-161-1/+1
| | | | | | | | Else on Windows there's a warning: conversion from 'size_t' to 'uint', possible loss of data Change-Id: Ifed4899409a13fed31c206ae1e0f195280ee2925 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Introduce new mechanism to manage palette functionality in QMLVitaly Fanaskov2020-03-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main goals of these changes: 1) Add an ability to work with disabled and inactive palettes from QML 2) Eliminate massive code duplication in qtquickcontrols2 module 3) Provide easily extensible architecture for this piece of functionality Architectural part. Palette It was decided to not change existing QPalette, but add thin wrappers around it to provide all required functionality. These wrappers are highly coupled with QPalette class because of using some enum values from it. There are two new classes QQuickPalette and QQuickColorGroup. QQuickPalette class inherits QQuickColorGroup class and represents Active/All color group. QQuickPalette also provides an access to three color groups: Active, Inactive, and Disabled. In order to access colors the special class QQuickPaletteColorProvider is used. This is a wrapper around QPalette that provides some convenience functions. Interface The private property "palette" should be exposed. Implementation All private parts of classes that implement QQuickAbstractPaletteProvider have to inherit QQuickPaletteProviderPrivateBase class. This template class implement all functionality: create palette, resolve dependencies, connect objects etc. This is important to mention that related data is lazily allocatable on demand only. Hence, there is no memory overhead for regular items. Change-Id: I911424b730451b1ad47f68fd8007953b66eddb28 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQuickTextNodeEngine: reduce redundant rendering of glyphsWang Chuan2020-01-161-1/+1
| | | | | | | | | | | | | | The glyphs between two text blocks that have different text format will be rendered twice, and in this case the rich text will be display incorrectly.(e.g., the first text block is a superscript and the second is a normal text) Fixes this by reduce the redundant rendering of glyphs between two differently formatted text blocks Fixes: QTBUG-80759 Change-Id: I51ca3f7df1ad368d28df9beb6124a87bf50f0e01 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Prepare for QTextBlockFormat::MarkerType to be an enum classShawn Rutledge2019-10-091-3/+3
| | | | | | | | | Use it in fully scoped form, and treat it as int in qDebug. Unfortunately since QTextBlockFormat is not a QObject, we can't easily use Q_ENUM to have moc translate the enum values to strings. Change-Id: I2eb605e8f2756ce62dcbaffa6bfed237ada4021d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Small performance improvements suggested by clang-tidyAlbert Astals Cid2019-10-071-1/+1
| | | | | | | | | mostly add const &, a few std::move and in particular case, remove const so the std::move being done over the variable actually has effect Change-Id: Id611cd31bc012f219d7a17d4626b1c2a5fbddd66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-171-2/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/jit/qv4baselinejit.cpp src/qml/jsruntime/qv4vme_moth.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: Iec7cd27ddad0281bd3b7833fb6b252f66a6ae5d6
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-121-2/+2
| |\ | | | | | | | | | Change-Id: I6472cd72b27c69257efe54376e428274ebf68050
| | * QQuickTextNodeEngine: don't create background when its alpha is 0Wang Chuan2019-08-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the alpha value for the background color of a text element is 0, we don't need to create a rectangle node to represent it, as the rectangle will be invisible anyway. [ChangeLog][QtQuick][QQuickTextNodeEngine] don't create a new rectangle node as the background of text, when the alpha of it is 0 Fixes: QTBUG-76137 Change-Id: I40c624ee8f61740fd07e7d3751a78b6224882913 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-201-1/+1
|\| | | | | | | | | | | Change-Id: I9ce3eee3d6f88783b9e20110a2814bee805291a4
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-051-1/+1
| |\| | | | | | | | | | Change-Id: I042df89ddd381c7fbb944b7ff49d5b45b764fd47
| | * Fix possible crash with top/bottom aligned imagesEskil Abrahamsen Blomfeldt2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An image inside at the end of a text block which did not start at text position 0 would resolve to an invalid QTextLine, since we passed the document position to lineForTextPosition(), which expects the relative block position. If the image was aligned to top or bottom, so that the extracted QTextLine was actually accessed, this would cause a crash. [ChangeLog][QtQuick][Text] Fixed a bug where aligning an image to "top" or "bottom" could cause a crash under certain circumstances. Task-number: QTBUG-77217 Change-Id: Iaa239ba482f2a765703656e4116cbebb8435a66e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add Markdown support to TextShawn Rutledge2019-05-091-0/+11
|/ / | | | | | | | | | | | | "Markers" (only checkboxes so far) are a new feature too. Change-Id: I5a0ea337ec6cf8bdadf3b4729caaa579e8b625b5 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-131-7/+11
|\| | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp src/qml/animations/qsequentialanimationgroupjob.cpp Change-Id: I8b76e509fd7c8599d4cef25181d790ee28edab54
| * Text: render table cell backgrounds properlyShawn Rutledge2019-02-281-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickTextNodeEngine::addTextBlock() was noticing the background color of text fragments, including those within table cells (and adding to the colorChanges vector for rendering), but not rendering a rectangle for the background of the entire table cell. So while the color was correct, it only took up as much space as the text itself. Also, QTextDocumentLayout needs to be told how much width is available so that QTextDocumentLayoutPrivate::layoutTable() will allocate cell width appropriately in case width is given as a percentage, e.g. <td width="20%">. This is done by calling QTextDocument::setPageSize() with correct width in pixels rather than zero. Fixes: QTBUG-72457 Change-Id: I5c8f861829f76d1cf4044fccd1142c3817bb33bc Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QtDeclarative: replace deprecated functionsChristian Ehrlicher2019-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | Replace the deprecated functions with it successors: - QFontMetrics::width() -> horizontalAdvance() - QLayout::setMargin() -> setContentsMargins() Change-Id: I2a2557cdb2eaec40e2c9955a0082372c582ec6b8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-241-10/+17
|\| | | | | | | Change-Id: I57e4b762dcccf2f7f6e4b659f6fc8c40465d3322
| * Fix vertical alignment of images in a text documentLars Knoll2018-11-221-10/+17
| | | | | | | | | | | | | | | | | | | | | | The vertical alignment was not calculated correctly in all cases, this should fix it by retrieving the height and baseline for the current text line and doing the calculation correctly in all cases. Change-Id: I5bb650ede46dc03d51bf0f64b77dc4ca77d30fd2 Fixes: QTBUG-59310 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Igor Bugaev <freedbrt@gmail.com>
* | Render inline custom text objectsAllan Sandfeld Jensen2018-11-191-1/+1
|/ | | | | | | | | | | | In QTextDocumentLayout inline objects are skipped if they have a frame and the frame-style isn't inflow. That inverted should be to only render it if it doesn't have a frame or is the frame-style is inflow. Fixes: QTBUG-32525 Fixes: QTBUG-70748 Change-Id: I259281ea45c9ba7295c6b3e116a941314ada22e5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-24/+24
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-3/+3
| | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix flow text objects in beginning of RTL blockEskil Abrahamsen Blomfeldt2016-11-141-1/+6
| | | | | | | | | | | | | If the block is right-to-left and starts with a text object, it should be aligned to the right edge of the QTextLine instead of the left one. [ChangeLog][QtQuick][Text] Fixed placement of flowing text objects in the start of a right-to-left block. Task-number: QTBUG-43133 Change-Id: Id790e88f3464280f124c38b4260386b84cac8826 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickTextNode: Minor cleanupRobin Burchell2016-07-111-18/+18
| | | | | | | Move decorations to QQuickTextNodeEngine, as the only place that uses them. Change-Id: I7d0b2bf8979bf5d7e447beac02c3419da4edb759 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-1/+4
|\ | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp Change-Id: I26d6435a29cac3840bb567ade5149c2562a94bf9
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-101-1/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of 0e053528 was reverted in the merge, about lastTimestamp. It will be applied later in separate commit. qmltest::shadersource-dynamic-sourceobject::test_endresult() was blacklisted on linux. Conflicts: .qmake.conf tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp tests/auto/qmltest/BLACKLIST tests/auto/qmltest/qmltest.pro Task-number: QTBUG-53590 Task-number: QTBUG-53971 Change-Id: I48af90b49a3c7b29de16f4178a04807f8bc05130
| | * QQuickTextNodeEngine: early out if no document layout.Edward Welbourne2016-06-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | As Coverity (CID 22302) points out, qobject_cast<> can return NULL; if we don't get a document layout, then we have no frame decorations to add to it. Change-Id: I2cd428456b3a3b24a28a5dd18ce948a8e95d21cb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | QQuickTextNodeEngine: Use correct boundingRect when merging nodesAndy Nichols2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use the transformed QRectF of otherNode instead of the untransformed boundingRect of the QGlyphRun. Change-Id: Ie2a97cccee45e2b924c2f599d8d3855aa85a4713 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | QQuickTextNodeEngine: Update boundingRects when merging nodesAndy Nichols2016-03-031-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGlyphRun has the behavior that it will calculate it's boundingRect based on the united rects of its contained glyphs unless a boundingRect has been previously set. In the case of QQuickTextNodeEngine the QGlphyRuns are coming from lines in a QTextDocument which would have already had setBoundingRect called. For the QGlyphRun that results from the merging of text nodes to have the correct boundingRect we would need set the united boundingRects of the nodes merged. This could go overlooked with the default renderer because it doesn't need to know the boundingRect of the QGlyphRun to render accurately. However this detail is important for partial update support with Qt Quick 2D Renderer. Change-Id: I4a5bd20afcfadf6cb0ad0659f9a797a980b47a81 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-191-3/+4
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp tests/auto/quick/qquickgridview/tst_qquickgridview.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I3cf47faa2fe567d62fffd985aeecbefe5811cc42
| * Fix off-by-one when checking overlaps in selection rangesEskil Abrahamsen Blomfeldt2016-02-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was found while researching QTBUG-49596. The selection ranges in the QGlyphRun are inclusive, so the length needs to be end - start + 1. For a node of 1 glyph with either preceding or succeeding node, we would detect an overlap always, since the initial rangeLength would be 0. This is reproduced by the textinput_selected_fallback_font.qml test, but the bug was hidden by a different bug in QTextLayout. Change-Id: I65d70b1223eebeb5cfbb277fade7f4753465364f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Move QQuickTextDocumentWithImageResources out of qquicktext_p_p.hJ-P Nurmi2015-10-291-1/+2
| | | | | | | | | | | | | | QQuickTextDocumentWithImageResources was autotest-exported in b63185. The problem is that the QQuickLabel in qtquickcontrols2 inherits QQuickText, and therefore includes the private header. An autotest- exported class with Q_OBJECT macro leads to a linking error: qquickcontrol.obj : error LNK2019: unresolved external symbol "public: static struct TestNamespace::QMetaObject const TestNamespace::QQuickTextDocumentWithImageResources::staticMetaObject" (?staticMetaObject@QQuickTextDocumentWithImageResources@TestNamespace@@2UQMetaObject@2@B) referenced in function "public: static class TestNamespace::QString __cdecl TestNamespace::QQuickTextDocumentWithImageResources::tr(char const *,char const *,int)" (?tr@QQuickTextDocumentWithImageResources@TestNamespace@@SA?AVQString@2@PBD0H@Z) qquicklabel.obj : error LNK2001: unresolved external symbol "public: static struct TestNamespace::QMetaObject const TestNamespace::QQuickTextDocumentWithImageResources::staticMetaObject" (?staticMetaObject@QQuickTextDocumentWithImageResources@TestNamespace@@2UQMetaObject@2@B) ..\..\lib\Qt5LabsTemplatesTestInfix.dll : fatal error LNK1120: 1 unresolved externals Change-Id: I7e8731973c4ad67fca40f87bf009dc55336c3d6f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-9/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * Fix selecting single character in middle of stringEskil Abrahamsen Blomfeldt2015-08-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for QTBUG-46829 revealed a bug in the code to handle selecting part of ligatures. The ranges were assumed to be [start, end], while they are in fact [start, end>. This would cause the engine to assume the previous node overlapped completely with the selected node and that the node had thus already been added to the graph. Due to the bug in QTBUG-46829, this accidentally worked before, but when that bug was fixed, this bug appeared. Change-Id: I517d260de9f58db4504dd4320b7113fbbe305a81 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Fix disappearing selection spanning different scriptsEskil Abrahamsen Blomfeldt2015-08-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the way itemization is currently done in Qt, Cyrillic text (and other writing systems) separated by spaces will become separate items because the spaces are itemized as Script_Common. In the Scenegraph's text node engine, we should merge these items into a single node as long as the same font is used for all the text. But a bug in the engine caused this to fail when the text was selected. The symptom of this was that in some rare cases one of the items would vanish if it were in the middle of a selection. In order to support the bearing of selected text leaning outside the selection rect, I previously added a hack which would add all selected text as unselected text as well in b0783c21fb54b939f07ddf5658cc51113b8014e6. This was an awkward way of doing it and caused said regression. A less intrusive way is just to add the text to the scene graph twice, as this does not interfere with the logic needed to support selecting part of ligatures nor the engine's ability to merge nodes correctly. [ChangeLog][Text] Fixed regression with selections spanning different scripts. Task-number: QTBUG-46829 Change-Id: I0faed76fb2cd1ac0b2e5cc54b81008b5e2550733 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix users of QTextLayout::additionalFormats to use the new APIMarc Mutz2015-06-051-1/+1
|/ | | | | | | | | QTextLayout::additionalFormats setters and getters using QList<FormatRange> have been deprecated; port to the QVector versions. Change-Id: I6702430c09b30aa033fe4e34f39a9aa3350e471b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix disappearing text in selectionsEskil Abrahamsen Blomfeldt2015-03-241-24/+28
| | | | | | | | | | | | | | | | | | Change 11a595e30615943cd6c63f08cc44cde7861112eb introduced a regression where selected text might disappear randomly because we changed the order the nodes were added to the list. The order is significant in cases where there is overlap, such as for painting selections. Instead of iterating over the hash and thus getting the regular nodes in random order, we make the first node with any given key the primary node, add this to the list immediately, and then just do a look up in the hash for the nodes that should be merged with it. Change-Id: Id2208ab672294aa3dd2bc9741e6c6697c2c66746 Task-number: QTBUG-45133 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* Reduce number of allocations when constructing text nodesEskil Abrahamsen Blomfeldt2015-03-091-36/+61
| | | | | | | | | | | | | | | | | | | | | In cases where you have a huge number of text elements that can be merged, we would do a lot of reallocations (one per node that would be merged into another). As the number of merges grew, this seemed to converge at about 50% of the time spent in updatePaintNode() in the text classes. We can almost eliminate this cost by only doing one realloc per node that will actually end up in the scene graph. This patch does a first pass where it simply bundles together nodes that can be merged. Then it does a second pass where it actually merges the nodes. In this second pass it can easily precount the required size of the arrays and we can limit it to a single realloc. Task-number: QTBUG-37365 Change-Id: I4e44c01cd83df39304cbbce34f3b8f773763e091 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * Fix vertical positioning of the first image in TextJoni Poikelin2015-02-021-1/+1
| | | | | | | | | | | | Task-number: QTBUG-38528 Change-Id: Ie16000cf9ba20598da51683751a8fb62798a1322 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Account for leading when drawing text decorationEskil Abrahamsen Blomfeldt2015-02-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the text line is offset by the leading distance, the text decoration needs to be offset by the same value, otherwise it will be drawn in the wrong location. [ChangeLog][TextEdit] Fixed positioning of text decoration with some fonts. Change-Id: Ic15134326b878255a9b424c14762c3817dfd3123 Task-number: QTBUG-44492 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Andrew Knight <qt@panimo.net> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* | Respect the text's background-color when it is set in the style in HTMLAndy Shaw2015-02-051-0/+7
| | | | | | | | | | | | Task-number: QTBUG-36837 Change-Id: Iea85f4bc7c66124178a318f0ebd776726cf72c96 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Fix subscript and superscript for QQuickTextJoni Poikelin2014-10-211-1/+12
|/ | | | | | | | Task-number: QTBUG-32948 Change-Id: I4920015b2604afbd9e2050f0225de98d5188d589 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Fix missing glyphs in selectionEskil Abrahamsen Blomfeldt2014-10-091-17/+56
| | | | | | | | | | | | | | | | | Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the new selection algorithm which would occur sometimes when a given run of text spanned several script items. Since we are checking the glyph runs for overlaps in the actual text, we need to report the exact characters spanned by the glyph run. We use the new enabler for this in QGlyphRunPrivate. Added a new test case which is an error case we did not yet cover, which is when there is only a single script item, but several font engines are used to produce it (fallback fonts). Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b Task-number: QTBUG-41808 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix selection of text with negative right bearingEskil Abrahamsen Blomfeldt2014-09-021-59/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Selecting text with a negative right bearing (like italic text) would cause clipping to occur at the edges of the characters. The algorithm for drawing text and text selection tried to divide the text into two: 1. Selected text, and 2. Unselected text. However, the selected text might be drawn outside the selection rect when it has a negative right bearing. Similarly, unselected text before the selection might overlap with the selection rect when it has a negative right bearing, or unselected text after the selection might overlap if it has a negative left bearing. See added test textinput_italic_selected.qml for an example. To rectify this, we do drawing of selected text like this: 1. Draw all text with unselected color 2. Draw selection rects 3. Draw the following in the selection text color and clipped to the selection rect: A. The selected text B. The unselected text right before the selection C. The unselected text right after the selection To avoid drawing the same text twice for extra boldness, we check if 3B or 3C actually contain 3A, in which case we skip 3A. [ChangeLog][Text] Fixed clipping when selecting text with negative right bearing. Task-number: QTBUG-34233 Change-Id: I3506b3a72a2d963c5f24c5b819bbb92769b9aee1 Reviewed-by: Samuel Nevala <samuel.nevala@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>