summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Make letter spacing APIs in QTextFormat more consistentEskil Abrahamsen Blomfeldt2012-08-272-34/+48
| | | | | | | | | | | | Change d060b6f04f956ab3a6358f826dc6928b3353f5f7 introduced some new properties to QTextFormat which were unfinished and did not match the documentation in the same change. I've updated the API and docs to use the regular QFont enum for letter spacing type instead of introducing bools (which inhibits expansions later) or mutually exclusive properties in the text format. Change-Id: Ife44993b6746c413e421fdaf92ebaaab6ba95977 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* doc: Fix doc warnings for qtextlayout.cppEskil Abrahamsen Blomfeldt2012-08-251-3/+7
| | | | | | | | | \Auml for a with umlaut doesn't seem to work with qdoc anymore, so replace this with the unicode value instead. Also, add reference to arguments in glyphRuns() function. Change-Id: I31861b384b822d1fbdcafbeeac07ea68a0e5fd07 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* doc: Fix several text-related qdoc warningsEskil Abrahamsen Blomfeldt2012-08-258-24/+26
| | | | | | | | | Also adds a new snippet which is just copy-pasted from the old documentation, because the snippet-file previously referenced seems to have disappeared. Change-Id: I0180715544321e076acda769cbdcbf19d50a971b Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Speed up QTextEngine::setBoundaryOlivier Goffart2012-08-231-6/+14
| | | | | | | | | | | | | | Before, setBoundary was O(N), now it is O(log N) assuming the boundaries are added in order. (splitItem might still be linear because of the call to QVector::insert) This speeds up a lot QTextEngine::addRequiredBoundaries when there is a lot of addFormats. (For example if there is a very long line with syntax highlighting) Task-number: QTBUG-8389 Change-Id: I10c9fca72343f46db24b1d4f519f7747188d4009 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Speed up QTextEngine::resolveAdditionalFormatsOlivier Goffart2012-08-231-2/+65
| | | | | | | | | Don't call the linear QTextEngine::format in the loop. Instead, keep track of the current formats by indexing their start and end position. Task-number: QTBUG-8389 Change-Id: I89c18b804111edfab6254442cbee33da39d1a273 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* doc: Remove documentation for removed functionEskil Abrahamsen Blomfeldt2012-08-231-12/+0
| | | | | | | | Function was removed in 1582407fc782c0befd0760633324dd5c206524a1, but the documentation was left behind. Change-Id: Ib59197221e3be0e13db958ab3efdcc95b7c52452 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move Qt::CursorMoveStyle docs to the right file.Frederik Gladhorn2012-08-231-15/+0
| | | | | | Change-Id: I26cc7336b33495a2649285cfeddeadec62e94d83 Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Fix docs for QRawFont.Jason Barron2012-08-211-2/+2
| | | | | | | Use correct function name for 'swap' and replace QGlyphs -> QGlyphRun. Change-Id: I4997a59ef643c688e8084a2013208fb760a2784a Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Doc: Small addition to QAbstractTextDocumentLayout::registerHandler()Geir Vattekar2012-08-181-0/+2
| | | | | | | Task-number: QTBUG-23345 Change-Id: I6f768472aaef95f5dd88cf896ef3e635d223b635 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@nokia.com> Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Register QTextDocument* as a meta type to fix QTextEdit::document typeJ-P Nurmi2012-08-182-1/+3
| | | | | | Change-Id: I666845049749bfa6f88b764eefaefb0dcf05cb3f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QtGui: collapse two qgetenv() on the same variableMarc Mutz2012-08-071-1/+2
| | | | | | | | | | Store the result in a temporary QByteArray and continue working with that one. Change-Id: I24bc243f0f3dfb37d840faf7592b3383bd37c7e2 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* change \img to \image in docsJeremy Katz2012-08-013-5/+5
| | | | | | | | \img was a macro defined in macros.qdocconf. This collection of macros is being phased out. Use the full command instead. Change-Id: Ia55212f87bb46349d61359d40568e0aa33882596 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Correct method name referred to in QFont's detailed description.Mitch Curtis2012-07-271-1/+1
| | | | | | | | | | The detailed description of the QFont class reference contains the wrong method name (and link) setPointSizeFloat(). This change replaces it with the correct name: setPointSizeF(). Task-number: QTBUG-15536 Change-Id: Ieb2e398b8e1d0b637a6bac16a3ec48522c5dddc1 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Avoid crash when getting bearings from fallback font engineEskil Abrahamsen Blomfeldt2012-07-141-0/+1
| | | | | | | | When accessing a fallback engine, we always need to call ensureEngineAt() to make sure it's loaded. Change-Id: Ib27e34137cfe8a3dd2b358aef3b3296a4ca52478 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix crash when column is inserted before rowspanned cellEskil Abrahamsen Blomfeldt2012-07-121-3/+23
| | | | | | | | | | | | | | When you're inserting a column in front of a rowspanned cell and this cell is not the first in the rowspan, we would get the wrong logical index of the new cell (putting it in front of the initial cell with the rowspan). If the cell does not span all rows, the table will get into a broken state and trigger asserts in update(). To fix this, we search for the first cell after the insertion point which has a logical index higher than the cell directly before the insertion point. Change-Id: I42e91a20d77b2ba9c5607f6cab23f51ed888cbd3 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* QtGui: declare some classes as sharedMarc Mutz2012-07-108-1/+29
| | | | | Change-Id: I0ebb0ca8b8edcecc939021407d1755693f97e553 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Color transparency support in html import/exportAlexey Chernov2012-07-102-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Export of color transparency component is added for cases where color is exported to html. New static function colorValue() is added to prepare CSS string representation of QColor. When the color is opaque, it falls down to QColor::name() method which was used previously, otherwise it returns 'rgba()' CSS statement or 'transparent' keyword in case transparency is 0. 6-digit precision is used for alpha value as it's maximum which can be processed properly by Gecko and Webkit engines (http://lists.w3.org/Archives/Public/www-style/2009Dec/0295.html). Import part for rgba() statement was also added to QCssParser. It supports rgba() color values as stated in CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/#rgba-color). Import of undocumented statement 'rgba(int,int,int,int);' was also added to preserve regression test success and to provide compatibility with previous code relying on this behaviour. Test cases added to QCssParser autotest for rgba(int,int,int,float) statement and to QTextDocument autotest for rgba(int,int,int,float) and 'transparent' statements for certain 'color', 'background-color' and 'bgcolor' properties. Change-Id: Id341c4e800249820d52edef8003e50f9a74d062b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Optimize QFontMetrics:: boundingRect() and left/rightBearing()Konstantin Ritt2012-07-101-6/+6
| | | | | | | | by avoiding unneeded metrics calculation. Same optimization for QFontMetricsF. Change-Id: I7fd0caa2ddb45862ee9e9c0519a71b03bcd0cb6f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Optimize Q*FontEngine*::stringToCMap()Konstantin Ritt2012-07-103-6/+14
| | | | | | | | | | | by avoiding the glyph metrics calculation when those metrics weren't requested (QFontEngine::GlyphIndicesOnly flag has been passed). As a side effect, this fixes a crash in case QGlyphLayout was initialized only partially (with the glyphs array and the size). Change-Id: I7d67abc2a74683131361fa21f8be203f61f247bc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Move ShaperFlags enum from QTextEngine to QFontEngineKonstantin Ritt2012-07-1014-75/+68
| | | | | | | | These flags are specific to font engine(s) and has nothing to do with the text engine or the text layout. Change-Id: I4bb793c3c634b3cf0ae0a8a8c23b946fad5874b6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix cursor truncate to include line positionJiang Jiang2012-07-091-2/+2
| | | | | | | | | | | Since we could have moved the line position (QTextLine::setPosition), the truncating position should be adjusted with that. Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> (cherry picked from commit ca89c49fa2c5cbb3945897046f33eed9f7da846c) Change-Id: I89ea1a3776a50732181bdfea9e79b4dddef950d4 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Remove Library dependency on SettingsTasuku Suzuki2012-07-092-4/+0
| | | | | | | | made QLibraryInfo available with QT_NO_SETTINGS. QKdeTheme is removed when QT_NO_SETTINGS is defined. Change-Id: I63d619bb305e6c23985d9ea50c72d39a697b7a4b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove platform specific DirectWrite font engine from QtGuiEskil Abrahamsen Blomfeldt2012-07-033-839/+0
| | | | | | | | This has moved into the platform plugin, but it was still lying around in QtGui and hindering it from compiling. Change-Id: I47fa730453cbd8aa230ccc4651afd2e774023db6 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Add QChar::SoftHyphen enum valueKonstantin Ritt2012-07-031-1/+1
| | | | | | | | | Just like for the QChar::ByteOrderMark, `ch == QChar::SoftHyphen` is much more readable than `ch == 0x00ad // (soft-hyphen)`, etc. Change-Id: I9c85f14cfd979037d35103c3259a435fd729b869 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove _qpa from cpp filenamesGirish Ramakrishnan2012-07-032-1/+1
| | | | | | | | 36547f4eff44361f7a6acd0cff107c0e47561f93 removed the _qpa from .h files and promised to remove it from .cpp files at a later date. Change-Id: I24a5c3796f6b07dd9a1931b699f3212d315edb12 Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
* QtGui: add member-swap to shared classesMarc Mutz2012-07-0315-0/+95
| | | | | | | Implemented as in other shared classes (e.g. QPen). Change-Id: I5b96d4a4795870d6252aa53de6fbaedde7c0095a Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* DirectWrite font engine: don't leak the font table bufferKonstantin Ritt2012-07-031-13/+11
| | | | | | | | | | | Ideally, each TryGetFontTable() call sequence should be followed by the call to ReleaseFontTable() with the context value taken from the first TryGetFontTable() call, otherwise we'll leak the buffer allocated for the font table. Change-Id: I627bf0133b7f61798e82929723ccfb780ce9ee69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix capitalization with newline bugYann Bodson2012-07-031-1/+1
| | | | | | | | | We only want to change the capitalization if the QScriptAnalysis flag was Lowercase, Uppercase or SmallCaps. Task-number: QTBUG-17485 Change-Id: Icbecb09b06a9153866ae81d592b3f6779c2dafb5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* shapeTextWithHarfbuzz() minor optimizationKonstantin Ritt2012-07-031-5/+7
| | | | | | | | | | | If the used font engine is of type QFontEngine::Multi, then we already have both the "font engine runs" and the stripped glyph indicies for the kerning -> just call the actual font engine's doKerning() method. If the font engine is not of type QFontEngine::Multi, then we could safely avoid the glyph indicies extra manipulations. Change-Id: Ia8899e6d7beecfd391b050683ac41c21465336e4 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Get started with patching up the Qt GUI docsGunnar Sletta2012-06-2819-0/+44
| | | | | | | | Primary goal, make the front page of the Qt GUI module a bit more clarifying and avoid downstream references inside the Qt GUI docs. Change-Id: Icbcfbb64b93963add889bf83711daa9575885c02 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add const & to foreach 'iterators'Albert Astals Cid2012-06-272-4/+4
| | | | | | | Change-Id: I8c0600dfd919f45d14a0011f2da9b9fe0b9a0df3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove all references to XLFD fontsLars Knoll2012-06-275-33/+10
| | | | | | | | XLFD fonts are no longer supported in Qt 5. Change-Id: I83400dab417c933d5cd956c0d168c45b9d79dab7 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QTextLayout docs: a minor typo fixKonstantin Ritt2012-06-211-1/+1
| | | | | Change-Id: I5e6d02f17e9064afe0c21dda806e67bc14c728b7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Disable hinting for scaled glyphs in FreeTypeJiang Jiang2012-06-141-0/+5
| | | | | | | | | | | | Scaling hinted glyphs looks ugly, and it makes smooth scaling animation not possible. Since nothing will work as intended in hinted mode, we should disable hinting automatically when glyphs are loaded with scaling transformation. Task-number: QTBUG-24846 Change-Id: Id7fb5f5bdc2d00be157b0c5d55c316473571473c Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QFontMetrics/QRawFont: Optimize SMP code points handling a bitKonstantin Ritt2012-06-144-11/+19
| | | | | | | | | Calling QString::fromUcs4() for the single UCS-4 -encoded character is quite suboptimal since the BOM detections and the resulting QString aren't really used; all we need is to split the UCS-4 code point into the UCS-2 surrogate pair. Change-Id: Ia5b68312909bf551cf2493d9e2752a7d7d837fb9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add the AGLFN tables generator, update the tables up to AGLFN 1.7Konstantin Ritt2012-06-142-175/+289
| | | | | | | Task-number: QTBUG-21727 Change-Id: Ib2cacc2a52b2853059d6c873a33dcde735fbe168 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* AGLFN: optimize glyph name lookup and reverse map creationKonstantin Ritt2012-06-142-15/+22
| | | | | | | | Use binary search in glyph name lookup, drop the linear search sentinel (0xFFFF); Pass the reverse map by ref, initialize with memset. Change-Id: I56de64bf2352af0615787e4cc0e13c922c640822 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make distance field image width variable.Yoann Lopes2012-06-121-20/+24
| | | | | | | | | | The distance field generator was always returning a 64x64 pixels image. It now returns an image with a variable width (width of the represented glyph) and always a height of 64px. Change-Id: Id5f11a50a8031ebca10cd4803adf179ccde6db26 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* QZip: improve reading of zip files, fix some edge cases in writingKonstantin Ritt2012-06-081-16/+141
| | | | | | | | | | This supercede https://codereview.qt-project.org/#change,25111 and fixes some more cases; The autotest crash is fixed as well (but the test itself omitted due to .pro file misconfiguration) Change-Id: I4a3adde18b4f9a8ac9822f700eee71d2a12b9c2c Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Namespace the bundled zlib symbols, to avoid clash with user zlibaavit2012-06-082-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | When Qt is being compiled and is using the bundled zlib, QtCore needs to export the zlib symbols, since zlib is needed in other Qt libraries as well. That gives a danger of a potentially disastrous symbol clash if the user later on links with both Qt and an external zlib (ref. e.g. QTBUG-15071). This commit enables a zlib compilation flag that causes all zlib symbols to be redefined with a prefix. Hence, they will not clash with a standard zlib. A minor drawback is that zlib.h will now have #defines for a few semi-normal identifiers. Hence, a couple of more changes are done: In the private qzip code, the identifer crc32 had to be renamed. QHttpNetworkReplyPrivate needed no change, but as a defensive measure the #include <zlib.h> is moved from the _p.h file to the .cpp file, to avoid surprising compilation errors later in code that include that header. This commit does not in itself solve the issue of how to let Qt libraries outside of qtbase use the same bundled zlib, but it is a prerequisite for that. Change-Id: If84105901a8c90d35009faffe660c85a6bd2fee5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Shift positions for lineBreakTypeKonstantin Ritt2012-06-071-2/+3
| | | | | | | | | | | | | | | | | | | to keep them consistent with positions for all other flags. This changes the internal behavior so that attributes[0].lineBreakType now means "break opportunity at start of the text (before the first character in the string)" and is always assigned with HB_NoBreak to conform rule LB2 (see http://www.unicode.org/reports/tr14/#LB2). The current implementation is based on the sample implementation from tr14 that aimed to be as simple as possible rather than to be optimal. From now, we can use pieces of the attributes array "as is" without having to adjust some positions. Or we can analize some long text by chunks (e.g. paragraph by paragraph) and consume less memory. This introduces a minor overhead that will be eliminated shortly. Change-Id: Ic873a05a9d5203b1c3d5aff2e4445a3f034c4bd2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* The QFontEngineFT files are not built into QtGui anymore.Thiago Macieira2012-06-052-13/+1
| | | | | | | | | | | | | These files are only built into QtPlatformSupport, so the Q_GUI_EXPORT macro is now wrong. Remove it. Additionally, since these files are built into QtPlatformSupport, the windows platform plugin does not need to build them again. To-Do: move the files to src/platformsupport/fontdatabases Change-Id: I9d69b97ca25ee52ab627cfa633f43b277acc5e05 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Remove QFont::handleGirish Ramakrishnan2012-05-313-14/+0
| | | | | | | This function is unavailable in QPA land. Change-Id: I43bb95d64e3abaa2fbcd8de07ca39c1d28f46f42 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Eliminate a warning in unsigned integer comparisonJiang Jiang2012-05-311-1/+1
| | | | | | | | The length we cast is from int QTextEngine::length() so it's safe to do so. Change-Id: I60fdbcb5a96c99b767093102a30e97951ef5b6ea Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Compile with clang when C++11 support is enabledBradley T. Hughes2012-05-301-1/+1
| | | | | | | | | | | text/qtextdocument_p.cpp:1070:43: error: non-constant-expression cannot be narrowed from type 'int' to 'quint32' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] text/qtextdocument_p.cpp:1070:43: note: override this message by inserting an explicit cast Change-Id: I16127aef2171324135b5c0c2ac611b8b4f03d7b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix text decoration width roundingJiang Jiang2012-05-301-1/+1
| | | | | | | | | | | | | | width passed in qreal should be set with setWidthF instead of setWidth, otherwise the fractional part is lost. Also remove the raster paint engine hack that has been removed in Qt 4.8, it's no longer needed. This fixed the drawUnderline and drawRightToLeft auto tests in tst_qglyphrun. Change-Id: Iace46fc27ff156c07fb4d08a145269fad36e9fdb Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Introduce QUnicodeToolsKonstantin Ritt2012-05-301-4/+4
| | | | | | | | | | | | | Add QUnicodeTools namespace and rename qGetCharAttributes to initCharAttributes; Make it possible to disable tailoring globally by overriding qt_initcharattributes_default_algorithm_only value (useful for i.e. running the specification conformance tests); This is mostly a preparation step for the upcoming patches. Change-Id: I783879fd17b63b52d7983e25dad5b820f0515e7f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QtGui: remove \link usagesGiuseppe D'Angelo2012-05-293-23/+20
| | | | | Change-Id: Ib8cca14a8fa35fbc631bfea9b4873225eac3677f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Replace `const QLatin1String &` with `QLatin1String` where appropriateKonstantin Ritt2012-05-252-2/+2
| | | | | | | Task-Id: QTBUG-24502 Change-Id: I360dee4dc68c165de0631ce4cf34e76fd873080e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Gestures & events: compile with QT_STRICT_ITERATORS.Thiago Macieira2012-05-251-2/+2
| | | | | | | | | | | There are a few mixed up iterators that needed cleaning up. We're missing a constUpperBound and constLowerBound function, though... This commit sneaks in one change to qtextformat related to QT_STRICT_ITERATORS but not to gestures and events. Change-Id: I8c7c840fb5f46c790adbf52952c6009c5b5f2f43 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>