aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Enable module build with QT_NO_IMTasuku Suzuki2012-11-261-0/+4
| | | | | | Change-Id: I90f8ec7e6357db7b4038bb1646fe9d3835821556 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
* Improved documentation of Text.textFormat property.Samuel Rødal2012-11-221-1/+5
| | | | | | | | Even though using RichText is not recommended, we should still at least point out what it does. Change-Id: I96d0e1e7074b5fdbb3a5dcaf84e5afe805c92080 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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>
* Various small doc fixes and improvementsBea Lam2012-08-091-3/+11
| | | | | | | | | | Adds some missing docs and fixes some incorrect doc references. Also removes AnimatedImage docs that were exactly the same as those in base Image type docs. Change-Id: I1357d3c00e63f1b08683bb78246de93dcc0dac7f Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Reset Styled/PlainText specific state when switching between formats.Andrew den Exter2012-07-311-0/+3
| | | | | | | | | Fixes markup being displayed when switching from a multilength string to styled text and formatting of elided text when switching from elided styled text to elided plain text. Change-Id: Id1e1834d81cb6142d92433a8bc571e05d226b7b3 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Doc: Changed \qmlclass to \qmltype and added \instantiates.Jerome Pasion2012-07-301-1/+2
| | | | | | | | | | -To simplify QDoc, \qmlclass is now \qmltype. -'\instantiates <C+++ class>' is for the types that are defined in C++. Change-Id: I29242d33daf7b972d8b86a356b9689638866b950 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Update element references to smooth.Michael Brasser2012-07-181-14/+0
| | | | | | | Change-Id: Ide30946e83c8c26d075b9ca3bb1f9e20afd69373 Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Change Quick docs to refer to "types" rather than "elements"Martin Jones2012-07-161-3/+3
| | | | | | Task-number: QTBUG-24785 Change-Id: I223479b879514abaacb123852323c1cfada7a5e1 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Remove unneeded mac specific code in QQuickTextYann Bodson2012-07-161-48/+16
| | | | | | | | We don't need to relayout in painting thread. Task-number: QTBUG-26361 Change-Id: Idfad1b90e2772e72411df821d02ea596a094f508 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Add option to use native rasterizer for SceneGraph textEskil Abrahamsen Blomfeldt2012-07-101-3/+42
| | | | | | | | | | 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>
* Fix warning about assigned/unused variable.Friedemann Kleint2012-07-101-4/+0
| | | | | Change-Id: I0c9a7c4bf52e5a1a81d5ac85fc594ad197e3b811 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Speed up Text construction with RichTextAndrew den Exter2012-07-091-0/+1
| | | | | | | | | | | | Setting the page size to empty can short cut some unnecessary layouts triggered by QTextDocument/QTextDocumentLayout prior to the Text item requiring a layout. This rougly halves the construction time a Text item with RichText. Task-number: QTBUG-19728 Change-Id: I03e6d293d8e5ac40046aef41171ca5009b718546 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Reduce the number of unnecessary layouts on geometry changes.Andrew den Exter2012-07-091-128/+227
| | | | | | | | | | | | | | | | | Improve checks for geometry changes that don't affect layout, i.e width increasing when the previous layout didn't wrap or elide. Set implicit sizes just once during layout rather than setting the implicit width during and the implicit height after to limit the when an implicit size change can change geometry. And if there are multiple layouts of the same text/font combination re-use cached layout data as much as possible by guarding against unnecessary property changes on the layout, and not creating a new layout for calculating the implicit size of truncated text. Change-Id: Ia05e52e9170e1f5d3364896ab119e00d8a318299 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix clicking on links in aligned or elided Text.Andrew den Exter2012-06-251-63/+45
| | | | | | | | | Adjust the mouse position to compensate for any alignment offsets and test the elided text layout for anchors if none is found in the normal layout. Change-Id: Idfda3f7e372d0f2d6c1b7bb5f22d7015d52e8239 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Create new documentation structureChris Adams2012-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | The documentation currently has no clear separation between Qt QML and Qt Quick. With recent commits like: 6c8378eaf1edbbefe6aaa3672b0127816a004fd7 and ab1e510121c8a679fdaca12ccd30e0f7ac12a26b the separation between the language definition and implementation, provided by Qt QML, and the standard library for the QML language, provided by Qt Quick, is clear. This commit creates a new documentation structure that is more navigable and separates concepts into logical categories, with clear separation between QtQML and QtQuick. It also provides a more generic QML Application Developer Resources page which contains links to information for QML application developers. Change-Id: Ia807ccfbfd24ffa0e1c7f0a51ed9d2ed3aa6a733 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Avoid string-based lookup in IS_SIGNAL_CONNECTEDKent Hansen2012-06-101-2/+2
| | | | | | | | | | Specify the signal as a member function suitable for passing to QMetaMethod::fromSignal(), and use the new function QMetaObjectPrivate::signalIndex(QMetaMethod) to get the index in the signal range. Change-Id: If16daa24c2699f7749a17decb611cf395d89d0c4 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix alpha being ignored in Text elementGlenn Watson2012-06-071-1/+1
| | | | | | | | The text element was using the implicit constructor to convert QRgb -> QColor which ignores alpha. Use the explicit conversion. Change-Id: I7975ffeab8b423716b9655776f38b0ca2f282cd0 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Doc: Grouped Qt Quick types into several groupsJerome Pasion2012-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -created new groups and converted some overviews into group pages -edited type documentation and added \ingroup -articles still need title fixes and link fixes Groups: qtquick-visual-types qtquick-item-graphics qtquick-shaders qtquick-canvas qtquick-text qtquick-text-validator qtquick-interaction qtquick-positioners qtquick-transformations qtquick-states qtquick-animation-define qtquick-animation-properties qtquick-animation-control qtquick-animation-modifiers qtquick-images-sprites qtquick-images qtquick-models qtquick-containers qtquick-views qtquick-paths qtquick-utility Task: QTBUG-25685 Change-Id: I81d4df3320bf5daad5cabb5e42408013fb24f464 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Make sure we relayout on height change when onLineLaidOut is usedYann Bodson2012-06-061-1/+1
| | | | | Change-Id: I66e47682eba337562543a99eb576a7e24d00cdcf Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix doc snippets paths and parsing errorsBea Lam2012-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtqml.qdocconf and qtquick.qdocconf now refer to the correct snippets and source directories. Snippet paths in .qdoc and .cpp files have been updated to refer to the new shortened path references, e.g. \snippet qml/file.cpp instead of \snippet doc/src/snippets/qml/file.cpp. This also deletes snippets from src/qml/doc/snippets that belonged under src/quick/doc/snippets (and were already duplicated there anyway) and restores some snippet files that shouldn't have been deleted. Also fixes some inline snippets to use \code .. \endcode instead of \qml .. \endqml as they contained javascript or partial QML snippets that were causing parsing errors from qdoc. There are still snippet errors arising from qmlintro.qdoc as the qmlintro snippets directory that it refers to cannot be located. There are also two references to a removed snippet identifier in examples/qml/cppextensions/plugins/plugin.cpp that need to be fixed in conjunction with the related docs in a later commit as the relevant code has changed and the docs are now invalid. Task-number: QTBUG-25721 Change-Id: I50c665245a74c140470c58a32546591d187dfe4b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Doc: Sanitized QML typesNico Vertriest2012-05-241-1/+1
| | | | | | | | | | -modified \brief -checked QML modules -added qml directory to the qdocconf file -added particles directory to the qdocconf file Change-Id: I589e32d3106cda37c7fa4d55a941afd9876fc2b2 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-1/+2
| | | | | | | | | | For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Doc: Moving Qt Quick docs for new doc structureGeir Vattekar2012-05-091-1/+1
| | | | | | | | | | | | | | | -moved documentation from doc/src/qtquick2 doc/src/localstorage doc/src/particles to src/quick/doc/ -fixed qdocconf file -fixed snippets, images, and other qdoc errors related to the new directories -fixed links in the main Qt Quick page Change-Id: Ie3408c2624f623c17de07e5635d5c7284d02b973 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fix alignment bug in QQuickText with multi-line text and implicit widthYann Bodson2012-05-031-1/+5
| | | | | | | | | | If the horizontal alignment is not left and the width of the text is not known during the first pass, we need to relayout once we know the maximum line width. Task-number: QTBUG-18617 Change-Id: I0cad100946beda151034067e23439185684de144 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix bounding rects of text items.Andrew den Exter2012-04-271-0/+10
| | | | | | | | | | 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>
* Also check notifier endpoints when checking whether a signal is connected.Michael Brasser2012-04-231-4/+4
| | | | | | | This is required for the QQmlBoundSignal optimizations. Change-Id: I63540b96cd7d4523ec49973a2540054c83d82b12 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Remove uninitialized variable.Andrew den Exter2012-04-201-4/+1
| | | | | | | | Relic from a prospective change to defer layout of text in more circumstances. Change-Id: I75d14e8cb01b86ab36ddbf58da99ba1cde14d801 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* 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>