summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote branch 'origin/master' into qt-master-from-4.6Thiago Macieira2010-02-207-5/+901
|\ | | | | | | | | | | | | Conflicts: configure.exe src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp
| * Merge branch 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into ↵Qt Continuous Integration System2010-02-192-1/+26
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1: (25 commits) Add convenience function QTextCursor::positionInBlock() Fixed URL in Russian translation. Designer/Resourceview: Suppress warning about QFileInfo on empty path. optimize qstring::simplified() Revert optimizations to QString::append unbreak QList::append() and co. again Implement bookmark manager widget. optimization: use QList::reserve() and QVector::reserve() amend "purge msvc.net and msvc2002 makespecs" Added QPlainTextEditor::anchorAt(const QPoint &pos) Fix memmory leak. Fix spacing. Prevent renaming the bookmarks menu root item, it's just a placeholder. Fix broken set last shown pagen when the last page was about:blank. Move launch with external app in base class. Make sure the bookmarks menu updates on add/ remove as well. Fix broken Drag&Drop, reset and clear the model if we set new bookmarks. avoid double reallocations in appending operations avoid double reallocation in string-growing replace() case optimize qHash() some more ...
| | * Add convenience function QTextCursor::positionInBlock()mae2010-02-192-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a missleading function QTextCursor::columnNumber() since 4.2, which almost never returns what you want. The pattern cursor.position() - cursor.block().position() is used frequently in code using QTextCursor. Reviewed-by: Roberto Raggi
| * | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2Eskil Abrahamsen Blomfeldt2010-02-191-6/+13
| |\ \
| | * \ Merge remote branch 'qt/master' into staging-2-masterQt Continuous Integration System2010-02-181-6/+13
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: tools/assistant/tools/assistant/helpviewer_qtb.h tools/assistant/tools/assistant/helpviewer_qwv.cpp tools/assistant/tools/assistant/helpviewer_qwv.h
| * | | Fix fallback for QStaticText when it's unsupported in paint engineEskil Abrahamsen Blomfeldt2010-02-192-7/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | When the paint engine does not support QStaticText, we fall back to regular drawText() calls. This fallback would previously paint all text to (0, 0). This fixes the qstatictext autotest on Linux. Reviewed-by: Olivier
| * | Fix warnings on gccEskil Abrahamsen Blomfeldt2010-02-181-3/+3
| | | | | | | | | | | | | | | | | | Gcc warns if declaration and initialization order are different. Reviewed-by: Samuel
| * | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2Jason McDonald2010-02-162-34/+50
| |\ \
| | * | Rename QStaticText::setUseBackendOptimizations to setPerformanceHint()Eskil Abrahamsen Blomfeldt2010-02-162-22/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the API more general and more readable by using a PerformanceHint enum instead of an on/off-trigger for the OpenGL-specific caching. Reviewed-by: Samuel
| | * | doc: Update documentation for QStaticTextEskil Abrahamsen Blomfeldt2010-02-161-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make some smaller modifications, fixes and additions. Remove \internal because the API is public now, and add documentation for QPainter::drawStaticText() since this was missing. Reviewed-by: TrustMe
| * | | Fix license headers.Jason McDonald2010-02-163-54/+54
| |/ / | | | | | | | | | Reviewed-by: Trust Me
| * | Compile fix for QStaticText - include declaration of QColorRhys Weatherley2010-02-151-0/+1
| | |
| * | Merge remote branch 'qt/master' into staging-2-masterQt Continuous Integration System2010-02-155-9/+16
| |\ \ | | | | | | | | | | | | | | | | Conflicts: tests/auto/qlineedit/tst_qlineedit.cpp
| * | | Support Qt::AutoTest in QStaticText::setTextFormat()Eskil Abrahamsen Blomfeldt2010-02-151-3/+3
| | | | | | | | | | | | | | | | The bit field has to be unsigned to support values of 2 (and higher.)
| * | | Merge branch 'qt-graphics-team-qstatictext-4.7'Eskil Abrahamsen Blomfeldt2010-02-154-2/+853
| |\ \ \
| | * \ \ Merge branch 'qstatictext-4.7' of ↵Eskil Abrahamsen Blomfeldt2010-02-158-28/+76
| | |\ \ \ | | | | | | | | | | | | | | | | | | git@scm.dev.nokia.troll.no:qt/qt-graphics-team into qstatictext-4.7
| | | * \ \ Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7Eskil Abrahamsen Blomfeldt2010-02-158-28/+76
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tests/auto/qlineedit/tst_qlineedit.cpp Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7 Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tests/auto/qlineedit/tst_qlineedit.cpp Merge branch 'master' of scm.dev.troll.no:qt/oslo-staging-2 into qstatictext-4.7 Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tests/auto/qlineedit/tst_qlineedit.cpp
| | * | | | | Separate out textFormat property from setText() function and removeEskil Abrahamsen Blomfeldt2010-02-153-24/+40
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isEmpty() function in QStaticText To make the return value of text() more intuitively clearer, and to make the API more readable, I've separated out the text format into a separate property. The isEmpty() function seemed out-of-place in the API, as suggested by reviews, so it has been removed.
| | * | | | Add API for rich text and getting actual size of QStaticTextEskil Abrahamsen Blomfeldt2010-02-143-26/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Required for several use cases, support for some html tags to change font, color and do advanced text layouts, as well as getting the bounds of the text when drawn.
| | * | | | Make QStaticText public API againEskil Abrahamsen Blomfeldt2010-02-105-183/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStaticText was previously made private API to support inclusion in Qt 4.6.x. This change turns it back into public API for Qt 4.7.0.
| | * | | | Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-101-6/+5
| | |\ \ \ \
| | * \ \ \ \ Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-083-5/+8
| | |\ \ \ \ \
| | * | | | | | Temporarily remove QPainter::drawStaticText() for Qt 4.6.x integrationEskil Abrahamsen Blomfeldt2010-02-053-39/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't add new symbols to QPainter for Qt 4.6.x, as we would not be able to remove them again if we regretted the API. Hence, I've made removable symbols instead, a private global function and a drawStaticText() in QPainterPrivate. In order to tie things together, I needed a static private-getter in QPainterPrivate, and hence it had to be a friend of QPainter. Reviewed-by: Trond
| | * | | | | | Revert changes made to QTextEngine for QStaticTextEskil Abrahamsen Blomfeldt2010-02-042-68/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes were made to QTextEngine for the sake of QStaticText, but as the implementation of QStaticText changed, these are no longer needed. Although they are harmless, I'll remove them to minimize the diff.
| | * | | | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Eskil Abrahamsen Blomfeldt2010-02-042-21/+60
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | qstatictext-4.6
| | * \ \ \ \ \ \ Merge branch '4.6' into qstatictext-4.6Eskil Abrahamsen Blomfeldt2010-02-013-4/+14
| | |\ \ \ \ \ \ \
| | * | | | | | | | Add private header warning to qstatictext_p.hEskil Abrahamsen Blomfeldt2010-02-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since QStaticText will be private API for Qt 4.6.x series, we need the regular warning in the header file.
| | * | | | | | | | Make QStaticText private APIEskil Abrahamsen Blomfeldt2010-02-015-182/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns QStaticText into private API in preparation for Qt 4.6.x. The related functions in QPainter are marked as internal in the docs. There are already internal functions in QPainter, so this seemed like a reasonable solution. Since the functions require QStaticText they will not be accessible to anyone who does not include private API.
| | * | | | | | | | Don't compare bool to char (avoid warning on MSVC)Eskil Abrahamsen Blomfeldt2010-02-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unsafe comparison since true is defined as non-zero only.
| | * | | | | | | | doc: Add \since to QStaticTextEskil Abrahamsen Blomfeldt2010-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStaticText will be added as public API in Qt 4.7, and as private API in Qt 4.6.
| | * | | | | | | | Improve performance of QStaticText on OpenGL by caching data on GPUEskil Abrahamsen Blomfeldt2010-01-293-15/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a big improvement to be seen in the OpenGL engine by caching the vertex data for the QStaticText in VBOs. In order to have the buffers properly disposed, I've implemented a userdata concept for QStaticTextItem. By default, the optimizations will be turned off, and can be turned on by using the useBackendOptimizations flag.
| | * | | | | | | | Remove unused constructor in QStaticTextPrivateEskil Abrahamsen Blomfeldt2010-01-292-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The copy constructor for QStaticTextPrivate was never called.
| | * | | | | | | | Initialize member variables in QStaticTextPrivate constructorEskil Abrahamsen Blomfeldt2010-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid crash when copying a QStaticTextPrivate object
| | * | | | | | | | Compile for SymbianEskil Abrahamsen Blomfeldt2010-01-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Missing include
| | * | | | | | | | CompileEskil Abrahamsen Blomfeldt2010-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compile QStaticText and also use font object in QPaintBuffer since it's now available
| | * | | | | | | | Add font object to QStaticTextEskil Abrahamsen Blomfeldt2010-01-202-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be needed by OpenVG paint engine, and is useful elsewhere.
| | * | | | | | | | Implement QPaintBufferEngine::drawStaticTextItem()Eskil Abrahamsen Blomfeldt2010-01-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QPaintEngineEx::drawStaticTextItem() pure virtual to make sure it's implemented in all engines, and implement the paint buffer version to make gui compile.
| | * | | | | | | | doc: Add some performance hints to the documentationEskil Abrahamsen Blomfeldt2010-01-151-4/+11
| | | | | | | | | |
| | * | | | | | | | Fix crash when wrapping textEskil Abrahamsen Blomfeldt2010-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two runs (counting the number of items and then storing the information) needs to be identical, so they need to have the same text flags set. Otherwise we would count more items than we actually generated and crash later when we tried to access an uninitialized item.
| | * | | | | | | | Update size commentEskil Abrahamsen Blomfeldt2010-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointers are included in the per item overhead.
| | * | | | | | | | Update size comment in QStaticTextPrivateEskil Abrahamsen Blomfeldt2010-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've added a flag char, so the size of the static text is now one byte greater.
| | * | | | | | | | Optimize drawStaticText() with rectangle destinationEskil Abrahamsen Blomfeldt2010-01-142-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to be feature consistent with drawText(), we have to clip the text whenever the text expands beyond its borders. This is a performance hit, but luckily we can detect the cases where it's necessary before-hand.
| | * | | | | | | | Add prepare() function to QStaticTextEskil Abrahamsen Blomfeldt2010-01-142-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the QStaticText layout to be completely defined prior to painting by introducing a function for setting the font and transform on the object ahead of using it with a QPainter.
| | * | | | | | | | Implement drawStaticTextItem() in OpenGL paint enginesEskil Abrahamsen Blomfeldt2010-01-142-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenGL and OpenGL2 engines now have support for static text, as well as the QEmulationPaintEngine. Also contains an optimization: Instead of passing both the position and glyph positions to drawStaticTextItem() we add the position into the glyph position and update it only when it changes. Otherwise we would have to do this work in all engines for every call. This means we have to cache the position in QStaticTextPrivate as well, but it seems like a small price to pay, since it's a per-text overhead and only 16 bytes.
| | * | | | | | | | Remove font property in QStaticText and fix handling translation onEskil Abrahamsen Blomfeldt2010-01-142-35/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | painter 1. The font property in QStaticText has been removed. Rather than set a font on the text explicitly, it picks up the font from the painter. If you change the font on the painter, the text layout will have to be updated, like with a matrix. 2. The translation might not be the only transformation on the painter, so rather than translate back to origo, we explicitly set dx and dy on the transform to 0.0 for the duration of the function. 3. Update test to reflect changes
| | * | | | | | | | Speed up QStaticText initializationEskil Abrahamsen Blomfeldt2010-01-141-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of translating each position manually afterwards, just have the matrix do it when calculating the positions inside getGlyphPositions().
| | * | | | | | | | Allow access to QStaticTextPrivate from autotestsEskil Abrahamsen Blomfeldt2010-01-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a private include which was unresolvable in autotests (because it indirectly included a 3rdparty header) and add Q_AUTOTEST_EXPORT.
| | * | | | | | | | Some documentation fixesEskil Abrahamsen Blomfeldt2010-01-141-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify the use of transformations combined with static texts.
| | * | | | | | | | Support transformations in drawStaticText() and optimize for spaceEskil Abrahamsen Blomfeldt2010-01-142-26/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Support transformations on the painter in drawStaticText(). Transforming the painter will cause the text layout to be recalculated, except for translations, which are handled by shifting the position of the text items. 2. Make const length arrays of the internal data in QStaticTextItem in order to minimize the memory consumption.
| | * | | | | | | | Optimize QStaticText for spaceEskil Abrahamsen Blomfeldt2010-01-142-78/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By caching the results of getGlyphPositions() we can make a code path in the critical paint engines which is optimal both in space and speed. The engines where speed is of less importance (pdf engine etc.) which may need more information, we choose the slower code path of drawText() which lays out the text again. We should have optimal paths in raster, vg and GL2 paint engines. The others are less important. Memory consumption of static text is now 14 bytes per glyph, 8 bytes per item and a static overhead of 40 bytes per QStaticText object.