summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-06-291-3/+7
|\ | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix text color in some cases of QML and QStaticText
| * Fix text color in some cases of QML and QStaticTextEskil Abrahamsen Blomfeldt2011-06-291-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts 518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3 which caused a regression. When writing systems are mixed and an underline is set on the font, QPainter will set a pen with the current color and a new width on itself before drawing the decoration. This would cause the recorder in QStaticText to mark the pen as dirty, saving the current pen color in all subsequent text items. The effect was e.g. that in QML the cached color would override the current one, making it impossible to change the color on the text without forcing a relayout somehow. The right fix is to only mark the pen as dirty when its color actually changes. Task-number: QTBUG-20159 Reviewed-by: Jiang Jiang
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7Laszlo Agocs2011-06-204-29/+134
|\ \ | |/
| * Fix glyph metrics with QStaticText/Freetype/raster and light/no hintingEskil Abrahamsen Blomfeldt2011-05-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | This is a back-port of part of cad70d64d0bbada. In the raster engine's drawCachedGlyphs(), which is used by QStaticText, we would use the wrong metrics to lay out the glyphs, because loadGlyphMetrics() would assume full hinting. A visible effect of this was that the baseline of rotated text became wavy. Task-number: QTBUG-18185 Reviewed-by: Jiang Jiang
| * Fix boundry conditions for cursor hit testJiang Jiang2011-05-251-1/+1
| | | | | | | | | | | | | | Clicking at the edge of a glyph means lookup for the left glyph. Reviewed-by: TrustMe (cherry picked from commit 31110bf84bb06d57983501fa65fe0db3f7c61927)
| * Fix cursor position test on CursorOnCharacter caseJiang Jiang2011-05-253-4/+9
| | | | | | | | Reviewed-by: TrustMe
| * Fix xToCursor issue due to backporting from 4.8Jiang Jiang2011-05-241-0/+2
| | | | | | | | | | Task-number: QTBUG-19260 Reviewed-by: TrustMe
| * Support placing cursor in ligature with mouse or touchJiang Jiang2011-05-233-7/+74
| | | | | | | | | | | | | | | | | | | | | | | | We need to find out the closest element in the ligature to the point we clicked (or tapped), currently we do this by dividing the width of that ligature glyph evenly by the number of characters it covered. We only support Common and Greek script at this point, ligatures in other scripts are still handled as a whole. Task-number: QTBUG-19260 Reviewed-by: Eskil
| * Fix ligature offset in multi-line textJiang Jiang2011-05-201-2/+2
| | | | | | | | Reviewed-by: Eskil
| * Make selection work across ligaturesJiang Jiang2011-05-201-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For widgets like QPlainTextEdit, selection across ligatures (typically 'fi', 'ffi', 'fl', etc.) end up highlighting the entire ligature glyphs, this patch fixed that by dividing width inside the ligature so that selection will not expand past the actual selected characters. Since cursor position already considered this, we merely adopted the algorithm and made it a separated helper function for all necessary cases. Dividing width directly looks like a temporary workaround but works well enough so far for cursor positions. Task-number: QTBUG-11969 Reviewed-by: Eskil (cherry picked from commit 99fd5825dfb4d50cff93165995701a65b7a8e4ed)
* | Revert "Symbian: Fix QFontInfo::pixelSize()"Alessandro Portale2011-06-162-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fcfc19878a0a1a48194a786bba64da11606077d2. I am happy that this commit fixed three bugs at once. But Actually, I am not sure if QTBUG-15513 should be fixed at this point. Fact is that the patch as it is would have changed the point->pixels calculation back to how it was in Qt 4.6. This means that the fonts which are defined with pointSize would now (in Qt 4.7.4) suddenly be bigger than they were in Qt 4.7.3. Imho this is unacceptable, as it would break all layouts which were developed for Qt 4.7 apps, when point size (instead of pixle size) was used. I will need to fix QTBUG-17844 without fixing QTBUG-13009 If QTBUG-13009 will be fixed for 4.8 will be discussed.
* | Proper naming for raster pixmap and paintengine on Symbian.Laszlo Agocs2011-06-163-3/+3
| | | | | | | | | | | | | | | | As QTBUG-19880 highlighted, the old S60 naming is not suitable for these classes anymore. Task-number: QTBUG-19913 Reviewed-by: Jani Hautakangas
* | Symbian: Fix QFontInfo::pixelSize()Alessandro Portale2011-06-142-4/+1
|/ | | | | | | | | | | | | | | | Unlike QFont::pixelSize(), which may return -1 if the font size was defined in points, QFontInfo::pixelSize() always needs to return a valid value. c4ef479906f073fa84999eb950f00e264ebd4e8e which was a fix for QTBUG-13009 tried to fix a similar issue, but failed to do that properly, which resulted in QTBUG-15513 and QTBUG-17844. This commit is supposed to fix all three bugs. Task-Number: QTBUG-13009 Task-Number: QTBUG-15513 Task-Number: QTBUG-17844
* Fix broken drawing with large fonts using QStaticText and FreeTypeEskil Abrahamsen Blomfeldt2011-05-181-1/+1
| | | | | | | | | | | | | In FreeType, there's a fall back to QFontEngine::alphaMapForGlyph() when the fonts are very large. Since this uses a QPainterPath containing an unhinted glyph, the use of hinted metrics would sometimes lead to the glyphs being clipped because they would be positioned slightly outside the image they were painted into. When outline drawing is on, it makes sense to return unhinted metrics, since the glyphs we will actually use are unhinted. Task-number: QTBUG-19067 Reviewed-by: Jiang Jiang
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-05-1796-1633/+1633
|\ | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Updating file with CRLF line endings for the updated header Fix a regression in QList::mid() update gitignore remove -fno-stack-protector Fix make confclean Update licenseheader text in source files
| * Update licenseheader text in source filesJyri Tahtela2011-05-1396-1633/+1633
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-05-131-1/+1
|\ \ | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Make TextEdit word selection more natural.
| * | Make TextEdit word selection more natural.Andrew den Exter2011-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTextControl will only extend the selection to a word if the cursor is directly over it which prevents the selection being extended if the mouse is dragged up or down a to a shorter line of text making it difficult to select multiple lines of text. Just disable that limitation when the TextEdit word selection is enabled. Change-Id: I3b9d1575c0141db8441197d740de94a90eacc077 Task-number: QTBUG-19230 Reviewed-by: Martin Jones
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-05-121-1/+3
|\ \ \ | |/ / | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Ensure the TextEdit cursor delegate is repositioned on mouse events.
| * | Ensure the TextEdit cursor delegate is repositioned on mouse events.Andrew den Exter2011-05-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update the micro focus when a mouse press changes the cursor position of a read only TextEdit. Change-Id: I11855037f7938b2cd23ac6ad165722b5289b4f46 Task-number: QTBUG-19109 Reviewed-by: Martin Jones
| * | Merge branch '4.7' of git://scm.dev.nokia.troll.no/qt/qt into 4.7Martin Jones2011-04-279-52/+76
| |\ \
* | | | memory leak fixTero Toivola2011-05-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If glyph is not found from glyphSet it is created dynamically and in this case not deleted. Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=244326 Merge-request: 1208 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* | | | Revert symbol addition in b033bb9Jiang Jiang2011-04-292-7/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | Because it breaks forward compatibility. We will use the original fix in 4.8. In 4.7 we just make sure it doesn't crash in QTextBlock::next(). Reviewed-by: Thiago Macieira
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-04-271-10/+6
|\ \ \ | |/ / | | / | |/ |/| | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Ignore changes to selectByMouse during a selection. PathView offset out of sync with currentIndex when items are removed.
| * Ignore changes to selectByMouse during a selection.Andrew den Exter2011-04-271-10/+6
| | | | | | | | | | | | | | | | | | | | | | Use the value of selectByMouse at the time of a mouse press event in all subsequent mouse events in a sequence. This is the same as ignoring the intial mouse press except mouse events for other actions are still accepted. Change-Id: I59b50bf95d26c6320e6e74eeb679b4153e0edf4d Task-number: QTBUG-18887 Reviewed-by: Martin Jones
* | Let QTextLine decide its own x position in QPainterJiang Jiang2011-04-193-18/+18
| | | | | | | | | | | | | | | | | | | | So that it can take trailing space width into account when doing right aligned text drawing. Backported from master. Task-number: QTBUG-18303 Reviewed-by: Eskil
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-04-131-0/+3
|\ \ | |/ | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix TextEdit cursorRectangle property.
| * Fix TextEdit cursorRectangle property.Andrew den Exter2011-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | Translate the cursor rectangle from control coordinates to painting coordinates rather than the other way around, ensure the cursor delegate is also translated, and update the cursor rectangle, cursor delegate and micro focus when the preedit cursor changes position. Change-Id: Iac7a87f7fb965d5f56d059d8f4b97feef8b47789 Task-number: QTBUG-18515 QT-4827 Reviewed-by: Martin Jones
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-04-113-1/+11
|\ \ | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make sure removed QTextBlock is invalid
| * | Make sure removed QTextBlock is invalidJiang Jiang2011-04-113-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the block is removed from document block map, we will mark the right node to the current head->freelist index, but it shouldn't be accessed directly, otherwise it can cause crash because of uninitialized node. Hence we need to check if a node index is equal to current freelist index. If so, it cannot be a valid block. Task-number: QTBUG-18500 Reviewed-by: Eskil
* | | Merge remote-tracking branch 'mainline/4.7' into 4.7Oswald Buddenhagen2011-03-313-3/+6
|\ \ \
| * \ \ Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-281-1/+1
| |\ \ \ | | |/ / | |/| / | | |/ | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix text selection with shift-click.
| | * Fix text selection with shift-click.Andrew den Exter2011-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the cursor when word selection is NOT enabled. If word selection is enabled then then cursor would have been moved in a previous branch, the (incorrectly inverted) check was to prevent that being overridden. Change-Id: I788c3b41c6fdb250d6086893ea98a1aa8c302514 Task-number: QTBUG-18017 Reviewed-by: Alan Alpert
| * | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-251-1/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make sure num_glyphs pass to HarfBuzz is large enough
| | * | Make sure num_glyphs pass to HarfBuzz is large enoughJiang Jiang2011-03-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Backport from master) Currently we only pass the num_glyphs for the run to HB_ShapeItem, but it can be less then the string length for this run because of Unicode surrogates. Thus, we need to pass at least the length of that run as num_glyphs to HB (given that we have enough space allocated because for the entire string), if that's still not enough, we will do ensureSpace again according to the num_glyphs returned by HB and move remaining glyphs backwards. Task-number: QTBUG-15679 Reviewed-by: Lars Knoll
| * | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-211-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Don't crash calling QTextDocument::blockBoundingRect on invalid block
| | * | Don't crash calling QTextDocument::blockBoundingRect on invalid blockEskil Abrahamsen Blomfeldt2011-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the block is invalid, QTextBlock::layout() will return 0 and we would dereference a null pointer. Task-number: QTBUG-18192 Reviewed-by: Jiang Jiang
* | | | Ensure the right font is used for rendering text on MacAndy Shaw2011-03-301-1/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | When ATSFontGetName() did not set name to the font name then it would cause Qt to fall back to a font that was not the right one. Therefore calling ATSFontFamilyGetName() in this case will help ensure it gets the right font. Reviewed-by: Jiang
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-151-22/+25
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Designer: Fix a bug affecting tab reordering of promoted tab widgets. Designer: Fix a bug clearing the Z-Order when adding a new widget. Adjust right bearing when breaking with line separators
| * | Adjust right bearing when breaking with line separatorsJiang Jiang2011-03-151-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we found a forced line break with line separator (e.g. '\n'), take the right bearing of previous glyph into account, otherwise the resulting text width will be slightly smaller than the one without a line separator. Task-number: QTBUG-17020 Reviewed-by: Eskil
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-141-2/+9
|\ \ \ | | |/ | |/| | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix TextEdit mouseSelectionMode overriding selectByMouse.
| * | Fix TextEdit mouseSelectionMode overriding selectByMouse.Andrew den Exter2011-03-141-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | If selectByMouse is false don't allow any text selection on mouse move. Change-Id: Ic9f309899bc0de48066a2393e088e15b3a2f06db Task-number: QTBUG-18072 Reviewed-by: Martin Jones
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-101-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix QGraphicsScene returning incorrect focus item. Not requiring valid QTextBlock in previous()
| * | Not requiring valid QTextBlock in previous()Jiang Jiang2011-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64852122ba7 introduced a regression in QTextBlock::previous(), programs that do doc.end().previous() will not be able to retrieve the last valid block. Revert this change so that we can keep the behavior consistent with previous versions. Task-number: QTBUG-18026 Reviewed-by: Eskil
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-091-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix unstable qdeclarativeflickable test. Update TextEdit's visible selection when only the anchor changes. Set correct initial value for TextEdit and TextInput canPaste property
| * | Update TextEdit's visible selection when only the anchor changes.Andrew den Exter2011-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the limits of a TextEdit's text a key press can change/reset the anchor position without changing the cursor position. Checking the cursor position alone isn't enough to determine the selection hasn't changed. Change-Id: Ic425ac0c06897d77e9c86b907ff10b39d78dd7a1 Task-number: QTBUG-17982 Reviewed-by: Martin Jones
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-041-2/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix TextInput auto test failure on mac. Fix word selection locking on string boundaries. Fix potential crash in QTextControl. QDeclarativePropertyMap::keys() cannot be called from qml Compensate for horizontal scroll in TextInput micro focus.
| * | Fix potential crash in QTextControl.Lasse Holmstedt2011-03-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | inputContext() is only safe to call if there is a current contextWidget. Change-Id: I6cbccf5f5fbb2d8c9ca6acf5f7e02f680eb84483 Reviewed-by: Andrew den Exter
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-02-282-7/+13
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix Mac synthesized italic fonts clipping issue for QGLWidget Fix cursor position adjustment when removing strings Fix out of bounds handling in Mac shaper
| * Fix Mac synthesized italic fonts clipping issue for QGLWidgetJiang Jiang2011-02-281-5/+10
| | | | | | | | | | | | | | Backport 43d5a0757d857c2a6694ae81d6b70c04ef876aff from 4.8. Task-number: QTBUG-16954 Reviewed-by: Eskil