aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickTextLine: set lineOffset to zero in ctor5.5Anton Kudryavtsev2015-12-171-1/+1
| | | | | Change-Id: Ie6b085157cebaf06750a30bc050b6bed0c7f6018 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix QQuickTextDocumentWithImageResources image loadingRoman Pasechnik2015-10-151-21/+17
| | | | | | | | | | | QQuickTextDocumentWithImageResources always tries to load images itself and not using QTextDocument internal resources. What it should do: 1) Check if QTextDocument already has image resource and use it. 2) If not, try to load resource manually. Change-Id: Ifc4d919fc4a08b4efae50e06a42f1af7cee67af3 Task-number: QTBUG-32525 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* qquicktext: Fix using CSS line-height with RichTextKai Uwe Broulik2015-07-201-1/+4
| | | | | | | | Only if lineHeight has explicitly been set it will override the block format. Task-number: QTBUG-45204 Change-Id: I6e0d6dd70460cbf436dda3e5640bb9b1d16d7e5a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Add QtQuick::Text::font.weight enum valuesShawn Rutledge2015-05-111-0/+4
| | | | | | | | | | Followup to 517da68893be9e6d97c7993922c573de9560604d in qtbase: make all possible font weights available in QML. Task-number: QTBUG-38482 Change-Id: I4f821d2fadbcd42fbb237903be474d67a0a5a7c9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Fix implicitHeight for Text items bindings dependent on implicitWidth.Andrew den Exter2015-05-041-0/+35
| | | | | | | | | | | | Recalculate the implicitHeight on the second layout if the width changes after setting the implicitWidth, and potentially do another layout if the updating the implicitHeight changes the height. Change-Id: Ib6a637452013b56dba7ae8a6862cd92156386578 Task-number: QTBUG-45546 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Fix Text item linkColor updateMarko Kangas2015-04-011-1/+4
| | | | | | | | Changed linkColor to update node correctly when link color is changed. Change-Id: I056811053e2287c93ba9c0afb5ceddef939f46ce Task-number: QTBUG-45356 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Fix invocations of static methods of QGuiApplication/QCoreApplication.Friedemann Kleint2015-03-051-1/+1
| | | | | Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Avoid assert in rich text when img width is invalidEskil Abrahamsen Blomfeldt2015-03-021-2/+2
| | | | | | | | | | | | | | If you set the width or height of an <img> tag to something invalid, this will be registered as -2 by the HTML parser. We should treat this case the same as if there is no width/height specified and use the implicit size instead. [ChangeLog][Text] Fixed assert when setting an invalid width or height on an <img> tag in a text element. Change-Id: Iae8c33fa184316632f72318e71f26ab005645a21 Task-number: QTBUG-44743 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-2/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * Merge remote-tracking branch 'origin/5.4.1' into 5.4Frederik Gladhorn2015-02-101-1/+1
| |\ | | | | | | | | | Change-Id: I127c746c4131fc907ea4b6713d307f12a4760666
| | * QQuickTextItem: fix crash on polishingGiuseppe D'Angelo2015-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "d->extra" pointer is lazily allocated, hence we must check if it's valid before dereferencing it. Task-number: QTBUG-44128 Change-Id: Id69c91e889193b0e9b73ed178c0ff3b13003227f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * | Fix Text wrapping when growing from 0 width.Michael Brasser2015-02-031-1/+1
| |/ | | | | | | | | | | | | | | The fix for QTBUG-30896 caused a regression in the test case. Now check both width and implicit width validity before resetting widthExceeded. Change-Id: I4aba2aad299746906cfe20e288fa60cfe2acc64f Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* | QQuickText: Move baseUrl to ExtraData.Robin Burchell2015-02-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's only used for external resource loading, which is not the common case. Note that the case of an unset baseUrl may become a little more pessimised now, as it has to be looked up from the context which involves a loop to find the outermost parent context, but again, this is not a common case, so I'd consider that acceptable. QQuickTextPrivate now goes from 496 bytes to 488 bytes. ExtraData increases from 72 bytes to 80 on x86_64. Change-Id: I7e346eeb3b3cefe81912aac2b115e106ec519d1e Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QQuickText: Decrease the size of QQuickTextPrivate by moving image tags to ↵Robin Burchell2015-02-121-48/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | ExtraData. Given that other data about images is already stored there (e.g. nbActiveDownloads), it seems curious to not store it all there. On x86_64, this drops the size of QQuickTextPrivate by 16 bytes (512 -> 496), and increases the size of ExtraData from 56 bytes to 72 bytes. Change-Id: Ib0a98199a74f757cf439d4ba276c7704504055b2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | 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>
* | QQuickText: respect new line width set by lineLaidOut() handler.Dmitry Volosnykh2015-01-211-6/+6
|/ | | | | | | | This commit makes text elide properly when custom layout is implemented. Task-number: QTBUG-44025 Change-Id: Iefe344079c002d3a79aea18096a71667f6c17add Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Fix grammatical error in Text and TextEdit documentation.Mitch Curtis2015-01-091-1/+1
| | | | | Change-Id: I6fd68166108a060931cd6bcd64ccd865d251a4c3 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Fix QQuickText alignment when lineHeight is setDaiwei Li2014-12-161-3/+14
| | | | | | | | | | | Text is always aligned to the top of the lineHeight rectangle, and no offset is added when verticalAlignment is set to AlignVCenter or AlignBottom. This change adds an offset based on the lineHeight and font height in those cases. Task-number: QTBUG-42050 Change-Id: Ibc63c80d4178b0f5c498cc126156df828855fd76 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Invalidate font caches when switching between threadsv5.4.0-rc1Eskil Abrahamsen Blomfeldt2014-11-131-3/+42
| | | | | | | | | | | | | | | | | | The font caches can only be used from a single thread at a time. QFontEngineFT for instance, uses a global static thread storage which is accessed on releasing and creating engines, and this causes a crash if the font engine is created on one thread and released on another. We use the updatePolish() function to make sure the caches are empty before entering updatePaintNode(), and then we invalidate the cache again after updatePaintNode() is done. [ChangeLog][Text] Fixed uncommon crash in text nodes. Change-Id: I01dbc2ed58aeebd03d77a157c700330334bdb385 Task-number: QTBUG-38800 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Relayout rich text when width increasesEskil Abrahamsen Blomfeldt2014-10-231-1/+0
| | | | | | | | | | | | | | | | | | | In updateSize() we were trying to force relayouts for RichText when the width changes by always setting widthExceeded to true. But further down in the same function, we overwrote this with textWidth() < idealWidth(), which doesn't work, because both properties are the wrapped width of the document and should only differ if the text cannot be wrapped properly. The result was that when increasing the width of a Text element, we would hit the optimization and skip the relayout. [ChangeLog][Text] Fixed Text with the RichText format to correctly update wrapping when the width of the element grows. Change-Id: I5fd87052a5ba7e8ee2549be0cfac4adc8ddf8290 Task-number: QTBUG-33020 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* 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>
* QQuickText::itemChange must call QQuickItem::itemChangeShawn Rutledge2014-08-081-0/+1
| | | | | | | | | The need for this was documented, but not done in this case. d5e612fb3e9753c762b741d135fabd2b1f8ae1a6 So it was not possible to use the windowChanged signal inside a Text. Change-Id: I4e3a49ca898cbd09b5731bd133cf93c212062fa2 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Clear the visibleImgTags list when setting up the text layoutAndy Shaw2014-07-241-1/+2
| | | | | | | | | Since the text layout is being redone then the visibleImgTags will be repopulated, therefore it should be cleared first so that it doesn't have duplicated entries. Change-Id: I415f94326e156ae265bc044544f2bb0d7146ce4c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Binding Text width to implicitWidth can result in incorrect layoutMartin Jones2014-07-111-2/+3
| | | | | | | | | If the text is not left aligned and the width changes during layout due to implictWidth changing, the text needs to be laid out again. Task-number: QTBUG-40161 Change-Id: I1ad679ccdc5595dd749600abe08ed46ac179d7bf Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Doc: correct link/compilation errors in Qt DeclarativeNico Vertriest2014-07-021-1/+1
| | | | | | | Task-number: QTBUG-34749 Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fix typo in QQuickText documentation.Mitch Curtis2014-05-071-1/+1
| | | | | Change-Id: Ic2e96e881fe13bcac11e7c172963e2c1e9928256 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Doc: Fix broken \qmlsignal linksSze Howe Koh2014-03-181-1/+1
| | | | | | | | Fix the breaks caused by the re-categorizing of \qmlsignal pages Task-number: QTBUG-35846 Change-Id: I528ae16ec522fc902133e22d8f53c87a7f0d56ad Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-6/+12
| | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-111-0/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
| * Docs: add a working example to Text::fontSizeMode docsJ-P Nurmi2014-01-291-0/+4
| | | | | | | | | | | | | | | | | | It's easy to miss the maximum bound specified by either the font.pointSize or font.pixelSize properties. Task-number: QTBUG-30005 Change-Id: If1dadebd6673f0e945a1ca95b64521f27d30f5a9 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Expose Text::linkAt(x, y)J-P Nurmi2014-01-291-2/+17
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick] Added Text::linkAt(x,y) method. Task-number: QTBUG-18946 Change-Id: I3b4071c6117ac0ee636f2fdbd2c392eb05b02dd7 Reviewed-by: Martin Jones <martin.jones@jollamobile.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Allow renderType: Text.NativeRendering on retina displays/devicesTor Arne Vestbø2014-01-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Setting the renderType to Text.NativeRendering might be needed in some cases where distance-field does not produce the expected results, such as for emoji characters or really large fonts. These use cases are valid on retina displays as well, so having the setter second-guess the request from the user to use native rendering is not ideal. Change-Id: I7c6049766e60574487c29de07fbd5c100ec69a2a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-241-4/+4
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/dialogs/qquickmessagedialog.cpp src/imports/dialogs/qquickmessagedialog_p.h src/qml/debugger/qqmlprofilerservice_p.h src/qml/jsruntime/qv4regexpobject.cpp tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
| * QQuickText: fix layout mirroringJ-P Nurmi2014-01-221-4/+4
| | | | | | | | | | | | Task-number: QTBUG-35095 Change-Id: I8550821e01ecc931788c1ed73366ba1ceed7a817 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-49/+49
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp src/quick/items/qquicktext.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I0bc5786098193c2c40b6fd8905de75d90f6ed0cf
| * Doc: Change the order of QQuickText function definitionsTopi Reinio2013-11-301-49/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For Text QML type, some property and method documentation is missing from the output because in the source file, they appear before the '\qmltype Text' command. This change reorders the functions so that qdoc will see all documentation for Text QML type. Task-number: QTBUG-35018 Change-Id: Icd995f66679d5105912ee12a7aeffd510921a54d Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | QQuickTextDocumentWithImageResources: use QTextDocument::baseUrlJ-P Nurmi2013-12-041-19/+8
| | | | | | | | | | | | | | | | | | QTextDocument::baseUrl was introduced in qtbase commit 1f22c1d. The ultimate goal is to get rid of QQuickTextDocumentWithImageResources and eventually make QQuickTextEdit's document interchangeable. Change-Id: Ibafeecc395b52f7200d8164f809bf76538e5620c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Support toggling antialiasing for Text and Rectangle.Michael Brasser2013-12-031-0/+28
| | | | | | | | | | | | | | Task-number: QTBUG-27968 Task-number: QTBUG-34366 Change-Id: Ic446ff4470abf21696e1764f902bd71e79762697 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Ensure correct horizontal alignment for implicit width multiline text.Michael Brasser2013-12-021-1/+1
| | | | | | | | | | | | Task-number: QTBUG-30896 Change-Id: I5ca18ac67cf3640c97374d79f2546fc53698f86b Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Ensure correct horizontal alignment when onLineLaidOut is used.Michael Brasser2013-12-021-2/+3
|/ | | | | | Task-number: QTBUG-34647 Change-Id: I07cb1f6f433d64c8889750a1fef06cd3b3bcc9e5 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Fix QQuickText hover event handlingJ-P Nurmi2013-11-051-12/+13
| | | | | | | | | | Catch hover events only when the item contains either rich or styled text, and make sure to ignore hover events as appropriate to propagate them further. Task-number: QTBUG-33842 Change-Id: Idef5be7c502711393ab532c4ace31663b0e0a872 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-4/+3
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-40/+40
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Made Qt Quick items' \since consistent.Jerome Pasion2013-09-251-2/+2
| | | | | | | | | | | | | | | | Qt 5.2: -"\since QtQuick 2.2" -> "\since 5.2" Qt 5.1: -"\since QtQuick 2.1" -> "\since 5.1" -"\since Qt 5.1" -> "\since 5.1" Qt 5.0: -"\since QtQuick 2.0" -> "\since 5.0" Task-number: QTBUG-32172 Change-Id: I699b00b31373a434ddb8f4caccfef40c588bf8a4 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-1/+1
|\ | | | | | | Change-Id: I2279f181b1c30e81651f8907447ec5c826e11475
| * Fix CLANG-warning '&&' within '||' [-Wlogical-op-parentheses].Friedemann Kleint2013-07-121-1/+1
| | | | | | | | | | Change-Id: Id724c86f87a78048df9b93f2d190593d36261943 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-041-0/+4
|\| | | | | | | Change-Id: I15cb7460171b38d11d66367aeb0831ec6e3ca933
| * Relayout the text after the vertical alignment is changedMarco Bubke2013-07-011-0/+4
| | | | | | | | | | | | | | | | | | | | In the designer it is no working without a layout update. Task-number: QTBUG-32041 Change-Id: I2276914c81b38ad8931109b3d800b65a0d11bca7 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>