aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext_p.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Support inline images with <img> tag in StyledTextYann Bodson2012-02-021-2/+1
| | | | | | Task-number: QTBUG-21793 Change-Id: Ie7b9f293c6c9a949c1899152c38b61251b0069d3 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add support for shared glyph cacheEskil Abrahamsen Blomfeldt2012-01-241-0/+1
| | | | | | | | Use a shared graphics cache to back the distance fields if it is available. Change-Id: Id5e6e7a28e38e349d787e66016b2d0faebc791d7 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Add a baseUrl property to Text and TextEdit.Andrew den Exter2012-01-191-0/+6
| | | | | | | | | Specifies the base URL which embedded links in rich text are resolved against. By default this is the URL of the item. Task-number: QTBUG-23655 Change-Id: Ib51b8503a18d9ac4e1801c77b77b3595d8f4912a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't load embedded images from the current working directory.Andrew den Exter2012-01-191-0/+3
| | | | | | | | | | | Override QTextImageHandler's image loading as it will attempt to resolve relative paths and load the image itself if the document returns an invalid image from loadResource, which we don't want as it bypasses the pixmap cache and resolves against the application and current working directory instead of the Text items context. Change-Id: Ia1d3633036f96d902e1ac03dae5d5b203fba7ff1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+251
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>