aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into ↵v5.15.11-lts-lgplTarja Sundqvist2023-06-091-0/+2
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I7b6e0ef657d1278405738f682b2795f8c345c3d4
| * QQuickText/Edit: fix C++20 -Wdeprecated-enum-enum-conversion warningsMarc Mutz2022-07-211-0/+2
| | | | | | | | | | | | | | | | | | Declare that HAlignment and VAlignment are designed to be mixed. Change-Id: I97663653014856a3391e36dd1847b67603f6aac9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c34cdee53f81ad0d645468ebae7aa9d8cab79a3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-241-20/+20
|/ | | | | | | | | | | This reverts commit 7b1331c789df0ac12d7cf5aa5f8967b8651a4cfa. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I47eb004523bdb3beb16e9fd51e40da6f738f9f34 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* Update commercial license headersTarja Sundqvist2021-02-021-20/+20
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtdeclarative. Examples, documentation files or tests are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4161 Change-Id: Ic1d011aa01b1fe7242bcbbf72d5ab454d1015cf9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Properly deprecate QQuickText::doLayout() and get rid of it for Qt6Jan Arve Sæther2020-02-281-1/+6
| | | | | | | It was only deprecated through its documentation. Change-Id: I0b7bdeec4ed965c3df627a03ab0e539c4e9c2018 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revision properties and methods added in 5.15Ulf Hermann2020-02-271-2/+2
| | | | | Change-Id: I00e3f9535e819d9d0d547c9d3cf50be469cf9339 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add API to get more information for each line in a QML Text elementTimur Kristóf2019-11-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Previously there was no way to know what area is occupied by each line in a QML Text element. This commit adds new API to expose implicitWidth and isLast on QQuickTextLine for use in the lineLaidOut signal. It also adds improved documentation to the lineLaidOut signal and an example usage of the new API to the text layout example. An example use case of the new API is eg. to allow embedding timestamps and indicators within a text paragraph, to enable creating more efficient layouts. [ChangeLog][QtQuick][Text] Added new API that exposes implicitWidth, and isLast on the QQuickTextLine for use in the lineLaidOut signal. This allows the user to layout other items relative to the lines of text. Fixes: QTBUG-78277 Change-Id: Ibc754db17c78efb01468106aba32e30d70d2f4df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Specify parameters of type registration in class declarationsUlf Hermann2019-09-261-0/+2
| | | | | | | | | | | | | | | | | | | | | Using this technique we can automatically register all necessary revisions and minor versions of a type, using the metaobject system. This greatly reduces the potential for mistakes and resulting incompatibilities between versions of imports. We assume that for each type we need to register all revisions of its super types and its attached type, and that the revisions match. That is, if you import version X of type A, you will also get version X of its attached type and of any super types. As we previously didn't take these dependencies into account when manually registering the types, a number of extra revisions are now registered for some types. Potentially, we can now generate the qmltypes files at compile time, using moc. Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add Markdown support to TextShawn Rutledge2019-05-091-0/+1
| | | | | | | "Markers" (only checkboxes so far) are a new feature too. Change-Id: I5a0ea337ec6cf8bdadf3b4729caaa579e8b625b5 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix QML compatibility for Text.contentWidth/Height changed handlersAlexander Akulich2018-10-251-2/+4
| | | | | | | | | | | | | | | | | | The properties used to have a single notifier that name is different from the properties names. QML Engine always connects a handler to signal, if it exists and only if there is no such signal then it lookup for a property notifier. In commit e92f76cf9ea91e87ec2e3e68234899fd9c12142f we introduced new signals that match the names of the two property changes handlers, but the signals are not available on older import. Remove revision number from the notifiers of Text.contentWidth/contentHeight to fix backward compatibility until a better solution (such as extra engine logic like "if a signal that matches the handler is not available then check if there is a way to connect to a property notifier that matches the handler" Fixes: QTBUG-71247 Change-Id: I11fb6230d85218ef437816c60c8147b953d47241 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Increase fine-grained signals for some properties in TextAleix Pol2018-07-311-4/+6
| | | | | | | | | | | | Text.[content/painted][Width/Height] were being always notified of changes at bulk. This is can be harmful in performance of QML applications that will trigger change requests on the program whenever a property is modified. This introduces separate signals so it's not a problem anymore. Change-Id: I5b82cf13158298dbc91157b837d0ed4aadeb86cf Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-271-1/+1
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-2/+2
| | | | | | | | | | | | | 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>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-12/+12
| | | | | Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add advance property to QQuickTextEskil Abrahamsen Blomfeldt2017-05-191-0/+2
| | | | | | | | | | | | | | | This is a step on the way to certain optimization possibilities for text in Qt Quick. Basically, to allow users the ability to split text into separate items (so that you can distinguish dynamic from static, and unshaped from shaped text), we also need a way to string those items together visually later. The advance property is required for this. [ChangeLog][QtQuick][Text] Added "advance" property to Text element. Task-number: QTBUG-56728 Change-Id: I8e7bf9bac410fa9c5553b48db90956431a2873f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add fontInfo property to TextEskil Abrahamsen Blomfeldt2017-01-311-0/+5
| | | | | | | | | | | | | | | | This provides a way to determine which font will actually be used to presenting the text, which can be especially useful when not using a fixed size font (the font info will then expose the actual font size used by the Text element.) [ChangeLog][QtQuick][Text] Added fontInfo property to Text type, providing a way to query properties of the actual font used for presenting the text. Task-number: QTBUG-51133 Change-Id: I5860fb1bd25ac5734713f49c8482428f2d531d22 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Deprecate Text::doLayout() in favor of forceLayout()J-P Nurmi2017-01-141-1/+2
| | | | | | | | | | | | | Item views and positioners all have now forceLayout(), so make the Text element API consistent with them. The old doLayout(), which sounds more like an internal helper method, is deprecated and marked for removal in Qt 6. [ChangeLog][QtQuick][Text] Deprecated doLayout() in favor of forceLayout(). Change-Id: I051988fca13c4cd84904f7b268d51f6a96f28af3 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-5/+5
|\ | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
| * QQuickText,QQuickTextInput: Fully qualify enumerations in changed() signals.Friedemann Kleint2016-04-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | Similar to change 85b64e701b2eaecdd30a7e0e079e2c80dd846fec. Fixes test warnings: QWARN : tst_qquicktextinput::mouseSelectionMode_accessors() QSignalSpy: Unable to handle parameter 'mode' of type 'SelectionMode' of method 'mouseSelectionModeChanged', use qRegisterMetaType to register it. QWARN : tst_qquicktext::textFormat() QSignalSpy: Unable to handle parameter 'textFormat' of type 'TextFormat' of method 'textFormatChanged', use qRegisterMetaType to register it. Change-Id: I9105eb31ce3d6203602649e24835f4fb0ddb25fd Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-291-1/+1
|\| | | | | | | Change-Id: Iec1b2de53c275996364c4bab0123ccb3e6e9895e
| * Preparations for re-rendering native text on DPI scaling changes.Andreas Hartmetz2016-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes only non-functional changes so the next patch can make mostly functional changes. QQuickText: rename q_imageLoaded() to q_updateLayout(). Says what it does, not when it is called. QQuickWindow: split QQuickWindow::forcePolish() into QQuickWindow::handleScreenChanged() and QQuickWindowPrivate::forcePolish(). Change-Id: Ief2ae30cd9f27ee8083b2c75765fb5278bde5ea8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | 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>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* QQuickText: add a protected constructorLiang Qi2015-09-081-0/+2
| | | | | | | Which is used in Label of QtQuick.Controls 2.0. Change-Id: I1228dba59a2a247c8d9556eed7c9a97782d91668 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Port from Q_ENUMS to new macro Q_ENUM.Friedemann Kleint2015-06-191-9/+9
| | | | | | | | | | | Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. QQuickXmlListModel::Status is left unmodified as porting it creates a link error in tst_qquickxmllistmodel. Change-Id: Id5e6192c9f85e7c94332508fbd91873ddda31e1a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Text: add support for paddingJ-P Nurmi2015-03-171-0/+31
| | | | | | | | | [ChangeLog][QtQuick][Text] Added padding, leftPadding, topPadding, rightPadding and bottomPadding properties. Task-number: QTBUG-41559 Change-Id: I5aa3a9eaad86de5e49d8e2da2a9f583e9a17222b Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Invalidate font caches when switching between threadsv5.4.0-rc1Eskil Abrahamsen Blomfeldt2014-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-111-19/+11
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickpainteditem.h src/quick/items/qquickshadereffectsource.cpp src/quick/items/qquickshadereffectsource_p.h Change-Id: If98096443afe85fc4370cef971eace050006a61b
| * 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>
* | Add Q_DECL_OVERRIDEAlbert Astals Cid2014-08-141-15/+15
|/ | | | | Change-Id: I2e64950aef710f943c3bc50bc9bf8a1f7fb58d28 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Expose Text::linkAt(x, y)J-P Nurmi2014-01-291-0/+2
| | | | | | | | | | [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>
* Support toggling antialiasing for Text and Rectangle.Michael Brasser2013-12-031-0/+1
| | | | | | | Task-number: QTBUG-27968 Task-number: QTBUG-34366 Change-Id: Ic446ff4470abf21696e1764f902bd71e79762697 Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* Add QQuickText::hoveredLinkJ-P Nurmi2013-06-181-0/+8
| | | | | | Task-number: QTBUG-30804 Change-Id: I6c6993b152285f4bdf34d6e1aa04f25fa7ca41e0 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-281-4/+0
| | | | | | | | | | | The macro was made empty in qtbase/ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Ia07e99676e0134fde5e32880edb95e57c779a7ff Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Alan Alpert <aalpert@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add option to use native rasterizer for SceneGraph textEskil Abrahamsen Blomfeldt2012-07-101-0/+10
| | | | | | | | | | For old-style (desktop components) apps using QML 2 on regular density displays, distance field text will look out of place. We introduce an option to use the native rasterizer instead if you would rather have native look and feel than scalable text items. Change-Id: Idb38e3c89f2deab9ae1963357c6c5fb235ddeab8 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Remove unnecessary exportsMatthew Vogt2012-05-181-1/+1
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix bounding rects of text items.Andrew den Exter2012-04-271-0/+1
| | | | | | | | | | Ensure the rectangles are correctly positioned with right and center aligned text, not just sized correctly. Also add padding to the clip rects so the cursor and styled text aren't clipped at the item boundaries. Change-Id: I03ef140589154ebd49b600b0a4c4fbeff845c10f Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Fix exports for the new Particles library.Friedemann Kleint2012-04-161-1/+1
| | | | | Change-Id: I3163c2bd00ad0d047f7fe2daa783e12071dd95b4 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-1/+1
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Reduce the size of QTextPrivate.Andrew den Exter2012-02-211-2/+2
| | | | | | | | Remove some unnecessary members, store colors as QRgb values instead of QColor, and reorder members to minimise alignment padding. Change-Id: Id3958429008c97a5714734a529250fe881e2161b Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Remove commit headersAaron Kennedy2012-02-201-1/+0
| | | | | | | | These were used when we were porting from QtQuick 1 to QtQuick 2 but are no longer necessary. Change-Id: I0eeb7e13b4affdd6ab6c6dddea760afcdf38ee4f Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add linkColor property to Text.Andrew den Exter2012-02-091-0/+5
| | | | | | | | | | | | | | | Allows the color of links in text to be changed from the default blue. This currently only works with StyledText and the distance field rendererer. It could be made to work with RichText overwriting the specified foreground color in all instances or by not setting a default color in the html parser. The former would prevent the color being set with CSS or some future means for altering text formats. The latter would break rendering with QPainter. Task-number: QTBUG-23048 Change-Id: I98df215cabe8a089f648fd4a6206622b4318fb8f Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add contentWidth and contentHeight properties to Text elements.Andrew den Exter2012-02-071-5/+7
| | | | | | | | | | | For Text and TextEdit this is a rename of paintedWidth and paintedHeight both of which remain as synonyms of the content properties for compatability. For TextInput this is a new property. Task-number: QTBUG-23691 Task-number: QTBUG-15160 Change-Id: Idbdc72fad34922be21b649ca45fc39b5e533ed1a Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Remove pixmap text caching in QML text elementYann Bodson2012-02-071-1/+0
| | | | | | Task-number: QTBUG-24033 Change-Id: Ifa24482b98536300c2f4c643a86517a019de8a84 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add support for resizing fonts to fit Text dimensions.Andrew den Exter2012-02-061-0/+24
| | | | | | | | | | | This adds a mode where if the content of a Text item doesn't fit within its bounds the font size is reduced during layout until it does or a minimum font size is reached. Task-number: QTBUG-22832 Change-Id: I6198ef03899e2f21b32e313548966ef4b0e3bff1 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Yann Bodson <yann.bodson@nokia.com>