aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix eliding when text width is reset by an implicitWidth change.Andrew den Exter2012-04-201-26/+19
| | | | | | | | After emitting implicit size changed signals, reevaluate any conditions that were dependent on the validity of the item dimensions. Change-Id: Ie4ee0c87a22cf82752c207c69d426056c36ede67 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't create glyphs for truncated text.Andrew den Exter2012-04-191-13/+17
| | | | | | | | Instead of positioning truncated lines far out of the way where they won't be seen, simply skip them when creating the glyph node. Change-Id: I83bd8f76619d822fb22ec2ebd8c1e45c45b8b990 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Don't crash when calculating the implicit width of truncated lines.Andrew den Exter2012-04-171-1/+2
| | | | | | | | | Remember to call beginLayout() on the QTextLayout before creating lines or the layout data won't be allocated. Change-Id: Ic344ca376fc25e38c50078135deb02dee3afc4f1 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Fix Text baselineOffset caclulations.Andrew den Exter2012-04-171-18/+44
| | | | | | | | | | Update the baselineOffset when short cutting layout due to an empty text property. And allow alterations to the baseline due to images, font scaling and custom layouts when doing a layout. Task-number: QTBUG-24303 Change-Id: I5a31a6108cded490fef8b0674e15558ea4e22d6b Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Do not automatically mark all text items as accessible.Frederik Gladhorn2012-04-031-3/+0
| | | | | | | | | | | | | This adds more confusion and fails more often due to invisible items and overlays that it helps. The test saw lots of "children" before that were text elements, these are gone now. With this the hack to make children based on item role invisible can go away. Change-Id: Ic5a3bba6e271747237e0e85168f4290bf596bc8a Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Fix warnings in qtdeclarative.Friedemann Kleint2012-03-301-5/+1
| | | | | | | | | | - QString from ASCII conversions - Unused variables - Pointer mismatches Change-Id: I5f76dce4f2ba481c2c2bce8681cf8107bd629566 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix horizontal alignment bug with rich textYann Bodson2012-03-261-2/+15
| | | | | | Task-number: QTBUG-21473 Change-Id: I3542d7fb49ec1ea370709c799167ec01cf5ed19c Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix text wrapping and eliding with implicitWidth.Andrew den Exter2012-03-221-10/+41
| | | | | | | | | | | | Update the implicitWidth of the item before continuing with the layout rather than after it's completed this gives any bindings dependent on the implicitWidth the opportunity to update the width before the layout continues. Task-number: QTBUG-22680 Task-number: QTBUG-24251 Change-Id: I61cd96ad9891b22d8b83937ad2c06719f88976b6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-131-47/+47
| | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I62d203f21df63a95ee236e578b10418fd9680707 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-118/+213
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Allow styled text to be elided.Andrew den Exter2012-03-011-9/+63
| | | | | | | | | | | | Task-number: QTBUG-24521 Change-Id: Idd451d0a8a238a60691386726e34054c0368b658 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
| * Reduce size of QQuickTextPrivateYann Bodson2012-03-011-86/+107
| | | | | | | | | | | | | | Move less used members to an extra struct lazily allocated Change-Id: I87e464af4b9d29303705dd7e766f734309ed7763 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
| * Don't round Text dimensions.Andrew den Exter2012-02-291-18/+19
| | | | | | | | | | | | | | | | | | Painting issues in QtQuick1 meant drawing had to be aligned to pixel boundaries, since this is no longer a problem we should use qreal everywhere. Change-Id: I58e88e10270fa603170f1cedf471bfb53bd89b73 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
| * Avoid unneccessary duplication of string data.Andrew den Exter2012-02-291-3/+11
| | | | | | | | | | | | | | | | | | Check for the existence of new line characters before trying to replace them. There's some redundancy if the characters are found but for single line strings we avoid the detach in replace. Change-Id: I48ccc614601a6f356b3d2e68f617e112c100bbdd Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
| * Fix Text eliding with implicit height and maximumLineCount.Andrew den Exter2012-02-231-2/+4
| | | | | | | | | | | | | | | | Ignore the height of the text if the element height is invalid. Task-number: QTBUG-24293 Change-Id: I1646c3f64583da40e6166aeea24c2c4af42cb279 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
| * Fix font size calculation in headings in StyledText.Yann Bodson2012-02-231-3/+12
| | | | | | | | | | | | | | | | | | | | | | Calculate the font size correctly even when the size is specified in pixels and update this size when the font changes. Also make sure that the text layout's font is set before parsing. Task-number: QTBUG-24458 Change-Id: Ida7723f6e4f4b9fd3a6878076f4beaf5bda8f7f7 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* | Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-29/+30
|/ | | | | | | | | | | | | 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-41/+47
| | | | | | | | 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>
* Avoid an unnecessary layout when eliding text.Andrew den Exter2012-02-171-22/+61
| | | | | | | | Query the elided text from the initial layout rather than doing a second layout of the line to be elided. Change-Id: I399f99a11046013c0c51add2e2f2dd14b959831a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix multi-length string substitution.Andrew den Exter2012-02-161-7/+26
| | | | | | | | | | Multi-length string eliding was provided by QFontMetrics::elidedText() which is no longer used for layouts. So we instead have to do the string substitution ourselves if the text doesn't fit before finally eliding. Change-Id: Iab2e54b332390290d656299a5be148f39f78df9d Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Better document with examples how relative paths are resolved.Andrew den Exter2012-02-141-0/+14
| | | | | Change-Id: Ia52956889216d11d7bb10307f09b582b55d0b4cd Reviewed-by: Martin Jones <martin.jones@nokia.com>
* QML Text: make sure that the bounding rect has a y position of 0.Yann Bodson2012-02-131-0/+1
| | | | | | | This line was lost in a previous merge. Change-Id: If3683fa17630452abab115638c1c0ebf0824e2a1 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Use QInputMethod instead of deprecated QInputPanelPekka Vuorela2012-02-101-2/+2
| | | | | | | | | | Similarly deprecate Qt.application.inputPanel and introduce replacement Qt.inputMethod. Change-Id: Ie4fd467f93f75023c86b0a2d038d858fe5001146 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Sami Kananoja <sami.kananoja@nokia.com>
* Add linkColor property to Text.Andrew den Exter2012-02-091-5/+32
| | | | | | | | | | | | | | | 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>
* Resolve StyledText img tags relative to baseUrl.Andrew den Exter2012-02-071-2/+8
| | | | | Change-Id: I954195d52330c65e851b7c0fcdb6c8dabf29335d Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Add contentWidth and contentHeight properties to Text elements.Andrew den Exter2012-02-071-13/+13
| | | | | | | | | | | 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-307/+35
| | | | | | Task-number: QTBUG-24033 Change-Id: Ifa24482b98536300c2f4c643a86517a019de8a84 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix updating text color in Text elementEskil Abrahamsen Blomfeldt2012-02-061-1/+3
| | | | | | | | | | The setColor() function in QQuickText calls markDirty() which did not specify that the whole paint node should be updated, so color updates would have no effect until something else changed. Change-Id: I93741b6c697f2dd6ad5a315250502a7a6e3ce1d7 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Add support for resizing fonts to fit Text dimensions.Andrew den Exter2012-02-061-153/+362
| | | | | | | | | | | 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>
* Cleanup: remove some debugging and use QQuickTextNode::addImageYann Bodson2012-02-061-17/+2
| | | | | Change-Id: I20f38f590b158d5d615923c30e85e2a7cfd99763 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Support inline images with <img> tag in StyledTextYann Bodson2012-02-021-13/+138
| | | | | | Task-number: QTBUG-21793 Change-Id: Ie7b9f293c6c9a949c1899152c38b61251b0069d3 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Clear Text formatting when setting plain text content.Andrew den Exter2012-02-021-0/+1
| | | | | | Task-number: QTBUG-21919 Change-Id: I55605d2bd053968868a885e63cc4bc042ada0839 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Document the limitations of AutoText's rich text detection.Andrew den Exter2012-02-011-1/+5
| | | | | | | | | | Repeat the explanation given in Qt::mightBeRichText's documentation for how rich text is identified and under what circumstances it may fail to recognize it. Task-number: QTBUG-21917 Change-Id: Ie012ddd2fd5f874da0ea819c354a1ed5b7573670 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>
* Fix updating of QML Text elementEskil Abrahamsen Blomfeldt2012-01-261-1/+1
| | | | | | | | | The negation in the test was left over from an earlier API and would break the test and most likely cause the Text element to always bypass its update. Change-Id: Idc5c94a76a0477a9433305f5aba43c4bb8d67806 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Add support for shared glyph cacheEskil Abrahamsen Blomfeldt2012-01-241-3/+24
| | | | | | | | 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-3/+52
| | | | | | | | | 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-24/+96
| | | | | | | | | | | 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>
* Adapt to QInputPanel::inputDirection() APIPekka Vuorela2012-01-121-1/+2
| | | | | | | Information moved from QGuiApplication into QInputPanel. Change-Id: Idd80609f4b67bffae7222a1fa27918724ebf60f6 Reviewed-by: Joona Petrell <joona.t.petrell@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>
* Support <pre> in StyleText textFormatMartin Jones2012-01-051-0/+2
| | | | | | | Task-number: QTBUG-23159 Change-Id: I842d066efb3a78defba61cc31060840f771f9b11 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add accessibility to qmlFrederik Gladhorn2012-01-021-0/+3
| | | | | | | | | | | | | | | This consists of two parts: An attached property for QML items and a plugin for the accessibility framework. The attached property simply takes care of some properties (name, role) that are needed in order to expose semantics of the application to assistive tools. The plugin exposes the hierarchy of QML items to the accessibility framework. Change-Id: I32f5603d0d9549b01b3645b205b710b9801762f7 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Small Text creation performance improvements.Martin Jones2011-12-201-27/+51
| | | | | | Change-Id: Ie92129887730d3738e14116cf22e1c30b836a415 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't enable multiline eliding unless wrap is enabled.Martin Jones2011-12-201-4/+4
| | | | | | | | | | Setting the height of the Text element to less than the height of the font caused the multiline eliding to activated. Also ensure multiline eliding only elides a truncated first line if it does not fit in the width allowed. Change-Id: If7e88d6ad82cb12cdb53d92616e62c3895611115 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Avoid Text layout being triggered unnecessarilyMartin Jones2011-12-071-17/+60
| | | | | | | | | | | Text was quite often layed out twice during construction due to geometry changes, and often at run time due to other geometry changes. This change checks for cases which do not require relayouting and drops out early. These are easier to detect than trying to have a single giant if statement covering all the positive combinations. Change-Id: I2deb2ab52d35b3d02bced698d05fef91c9e2f745 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add support for pixmap cache images to TextEdit.Andrew den Exter2011-12-071-40/+22
| | | | | | | | Re-use the QQuickTextDocumentWithImageResources class from Text to allow image resources to be loaded from the pixmap cache. Change-Id: I13170eefe664447b77f2980fb2fe7b4e2f8eb81c Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+1950
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>