summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Clarified QTextTable::mergeCells() documentationNico Vertriest2015-12-031-2/+2
| | | | | | Task-number: QTBUG-37928 Change-Id: I8d3ae3b540f9483d1e93d4c8135f777dea13f967 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Freetype font engine: Restrict bold depending on OS2 weight class.Friedemann Kleint2015-12-031-2/+6
| | | | | | | | | Limit setting bold to weights <=750. Task-number: QTBUG-48922 Change-Id: Id38b636698e58b0686dda9711ee1b3426a3b45b9 Reviewed-by: Gunnar Roth <gunnar.roth@gmx.net> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Round advances if subpixel position not supportedEskil Abrahamsen Blomfeldt2015-12-021-5/+5
| | | | | | | | | | | | | | | | | Due to kerning and other OpenType features, it's possible that the advances from the shaping process are fractional, but this gives uneven glyph positioning for font engines that don't support subpixel positioning (since the glyph will not match the expected position, some gaps will look too large and some too small). To match how e.g. GDI renders this, we round the advances before setting the glyph positions for engines that do not support subpixel positions. [ChangeLog][Windows] Fixed uneven kerning for some fonts. Task-number: QTBUG-48546 Change-Id: Ic00dc402abf7149aab6bf9b05b42827b805c1a15 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QTextOdfWriter: Added support for hyperlinks.Ilija Ristevski2015-11-301-0/+9
| | | | | | | | | | | Hyperlink added in QTextDocument becomes "<span>" tag after exporting the document to ODF with QTextDocumentWriter. Fixed by adding "<a>" tag around it with attribute "href" pointing to hyperlink location. Task-number: QTBUG-48853 Change-Id: I2bd689a88c9d0a5b14369777718b9cb36e4cfa19 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix QTextLine::cursorToX()J-P Nurmi2015-11-251-3/+1
| | | | | | | | | | 0e99f3c broke tst_qquicktextinput::horizontalAlignment_RightToLeft() and tst_qquicktextedit::hAlign_RightToLeft(). This fix was proposed by Konstantin. Change-Id: I602b7301d415f266224ae2c1ffd81244e9565862 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Optimize QTextEngine::findItem() usage casesKonstantin Ritt2015-11-233-9/+10
| | | | | | | | Since the item positions are guaranteed to grow, we could safely re-use the obtained first item while looking for the last item in the chain. Change-Id: I5e42f5de820c62a51a109a4b227b031c697aa898 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTextLine::cursorToX: Optimize by re-using the cached valuesKonstantin Ritt2015-11-231-10/+8
| | | | | | | (and move some code around) Change-Id: I2e26dcc7b769fdbcc750332845da11ec88e332dd Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTextLine::cursorToX: Always return the nearest valid cursor positionKonstantin Ritt2015-11-231-9/+9
| | | | | | | | The documentation already states we're doing this, so stop lying and implement it properly :) Change-Id: Ic78980d76f61e8aa64e59ea058a8105d9c507774 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTextLine::cursorToX: Fix typo in the documentationKonstantin Ritt2015-11-221-1/+1
| | | | | Change-Id: Iecdcab5145b147edbab78b08bd6c9e2dc2f18d48 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QFontEngineFT: Optimize format convertion code with template magicKonstantin Ritt2015-11-161-16/+38
| | | | | | | | Avoids in-loop check for every pixel by costs of slightly bigger code. Change-Id: I8321d0945ac6b677786431670b2316c60e4db492 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QFontEngineFT: Revise the legacy LCD filter implementationKonstantin Ritt2015-11-161-22/+15
| | | | | | | | | | | Use an optimized version of the intra-pixel filter found in FreeType's _ft_lcd_filter_legacy(). Gives us somewhat better accuracy and better performance. Change-Id: Id4200b67e6ff55f605037c3e5464fef8bb03fbde Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Fix falsely reported style for fallback fontEskil Abrahamsen Blomfeldt2015-11-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In change 8f6b3284106fa11129e4fa6e5ec3adc6cb1f489f we override the fontDef of the fallback font with the fontDef of the original font (with the family name replaced) to fix a regression where boldness was not inherited by the fallback font. This caused a bug, though, since the contents of the fontDef would now misrepresent the actual font used. The side effect of this was that isSmoothlyScalable() returned false because the family and styleName combination we claim to have did not exist in the font database. Result: We fell back to native rendering for the font even though it's scalable. Weight and style are the only parts that should be inherited, since they are synthesized. So rather than overwriting the fontDef completely, we copy the weight and style when needed. The bug in QTBUG-42963 is still fixed after this change. [ChangeLog][Text] Fixed problem where fallback fonts for text with certain styles would be reported as unscalable. Change-Id: I95ef67f818852aea5a6ae8df789a52364ecb59a6 Task-number: QTBUG-47547 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QFontEngineFT: Minor optimization to convertGRAYToARGB()Konstantin Ritt2015-11-131-6/+9
| | | | | | | | | Precalculate everything we can and use faster loop. Make inlined as it is used just in a single place. Change-Id: If3c33d60739eb4ce896020321442ae81edd1c13d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTextEngine: Apply CoreText specific post-processing for QFE::Mac onlyKonstantin Ritt2015-11-131-13/+14
| | | | | | | These tricks has no meaning to other font engines (i.e. to FreeType). Change-Id: I0410693d4d159367d760433062506691dc7c4610 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QTextEngine: Do not disable graphite2 HB shaper backendKonstantin Ritt2015-11-131-15/+14
| | | | | | | | | | | | This fixes-up bf013c9e745c63cb112be4d3a37027ff997927dd by specifying graphite2 shaper in a "safe" shaper list, one used for non-CoreText font engines (currently, FreeType font engine only). Make the the comment and the code a bit cleaner about the fallback shaper list. Change-Id: Ib0cedc0b593023c9ee771e8e98c314d9c8f13037 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QFontEngine: Check for AAT support only with HB-NGKonstantin Ritt2015-11-131-5/+3
| | | | | | | HB-old is unable to handle these anyways. Change-Id: Ibe69b5d030134b8a0a76dc966b6dfc6b5ff9a883 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Make qt_findAtNxFile return the source device pixel ratioOlivier Goffart2015-11-131-8/+12
| | | | | | | | QTextImageHandler needs it. And QQuickImageBase will also need it. Change-Id: Ica5d17519c4c6c06e25bab7d2b1d3733f4058425 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Update Unicode data & algorithms up to v8.0Konstantin Ritt2015-11-051-1/+9
| | | | | | | | | | | | | | | | | | | * Georgian lari currency symbol * A large collection of CJK unified ideographs * Emoji symbols and symbol modifiers * Letters to support the Ik language in Uganda, Kulango in the Côte d’Ivoire, and other languages of Africa * A set of lowercase Cherokee syllables, forming case pairs with the existing Cherokee characters * The Ahom script for support of the Tai Ahom language in India * Arabic letters to support Arwi—the Tamil language written in the Arabic script For more details, see http://www.unicode.org/versions/Unicode8.0.0/ [ChangeLog][QtCore] Unicode data updated to v.8.0 Change-Id: If255f95c9c45655b721369a116299da3cabbba0a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove historical +4 padding in QFontEngine::alphaMapForGlyph()Eskil Abrahamsen Blomfeldt2015-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Back in the old days, we would pad the output from the font engines to work around problems with the GL1 paint engine such as issues with linear sampling, etc. This is no longer needed. Padding is moved into the glyph cache, and in addition to reducing performance, the extra padding is also making alphaMapForGlyph() and alphaMapBoundingBox() fall out of sync when you fall back to QPainterPath drawing the glyph. The result of this was that, when prepared, the glyph cache was sometimes not made large enough to hold what alphaMapForGlyph() actually produced, depending on the size and order of glyphs, and glyphs ending up at the end of rows would sometimes be missing from the output. [ChangeLog][Text] Fixed some instances of missing glyphs when drawing large fonts. Change-Id: Ia5982392fe1637f6ebc740db9f226fbb91f75166 Task-number: QTBUG-47547 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Support overlapping contours in glyph rasterizer fallbackEskil Abrahamsen Blomfeldt2015-10-261-0/+1
| | | | | | | | | | | | | | | | | | Truetype fonts should be rasterized with a winding fill as documented in e.g. Microsoft's specs. Failing to do this caused a bug when doing native rendering in Qt Quick for fonts that were large enough that the fallback path was taken when drawing the glyphs into the cache. If the glyph had overlapping contours, they would be subtracted from the shape. [ChangeLog][Text] Fixed an uncommon rendering error with fonts containing overlapping contours. Task-number: QTBUG-41197 Change-Id: I0e4a4432ba3f902bc3ea59d8f4dbd12a295630b2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Add support for "@3x" image loading.Morten Johan Sørvig2015-10-161-13/+3
| | | | | | | | | | | | | | | | Implement as generic "@Nx" support in an exported qt_findAtNxFile function. 3x devices now get one extra file existence test in cases where @3x versions are not present. 1x devices are still on the fast path where there are no extra file system accesses. Add an @3x image to the highdpi manual test. Change-Id: I4ce3fc245ada01ea410abe1443ceb1e3abf7c17f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Insert leading after each line, not beforeUlf Hermann2015-10-091-2/+1
| | | | | | | Task-number: QTBUG-45791 Change-Id: I763d9d1ba00989d0c6b1e0b955173dadbef26b10 Reviewed-by: Stephen Chu <stephen@ju-ju.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QFontEngine: Read minimum left and right glyph bearings from 'hhea' tableTor Arne Vestbø2015-09-221-19/+55
| | | | | | | | | | | | | | This table has values precomputed based on every single glyph in the font, not just the subset we use as a fallback, which should improve both performance and correctness. The fallback codepath of computing the minimum values based on a subset of the characters in the font is left in, as we still need that for bitmap fonts, and some font tables that have invalid values. Change-Id: I71aac1e09c9f9de80446b023ba15a9e2afe7d226 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Serialize the capitalization value of QFontAndy Shaw2015-09-151-1/+7
| | | | | | | | | | | | | | | | By serializing the capitalization value of QFont, it ensures that it is correctly preserved when QPicture streams it and later plays it back. Subsequently the QDataStream version has been bumped up to account for the change of the data format for serializing QFont. [ChangeLog][QtGui][QFont] QFont now serializes the capitalization setting. [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 17 to account for changes in the serialization of QFont. Task-number: QTBUG-15214 Change-Id: I042680760e5a69d18d41e786b7500a3eebbe562f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Fix some doc warnings.Friedemann Kleint2015-09-111-6/+0
| | | | | | | | | | | | | | | | | qtbase/src/gui/text/qzip.cpp:797:warn:Cannot find 'FileInfo::d' specified with '\variable' in any header file qtbase/src/opengl/doc/src/qtopengl-index.qdoc:28:warn:Can't link to 'Qt Gui' qtbase/src/opengl/doc/src/qtopengl-module.qdoc:28:warn:Can't link to 'Qt Gui' qtbase/src/widgets/widgets/qcombobox.cpp:3033:warn:Cannot find base function for '\reimp' in showPopupFromMouseEvent() qtbase/src/corelib/plugin/quuid.cpp:849: warning: Can't link to 'variant()' qtbase/src/corelib/plugin/quuid.cpp:863: warning: Can't link to 'variant()' qtbase/src/widgets/dialogs/qsidebar.cpp:72: warning: Cannot find base function for '\reimp' in mimeTypes() qtbase/src/widgets/dialogs/qsidebar.cpp:80: warning: Cannot find base function for '\reimp' in flags() qtbase/src/widgets/dialogs/qsidebar.cpp:98: warning: Cannot find base function for '\reimp' in mimeData() qtbase/src/widgets/dialogs/qsidebar.cpp:134: warning: Cannot find base function for '\reimp' in dropMimeData() qtbase/src/widgets/dialogs/qsidebar.cpp:151: warning: Cannot find base function for '\reimp' in setData() Change-Id: I39d6494eb8179f0f7532f99458736fa5e30cdc25 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Move min left/right bearing calculations to QFontEngine baseclassTor Arne Vestbø2015-09-026-64/+86
| | | | | | | | | | | | | | | | The logic used in the FreeType font engine can be generalized and move to the QFontEngine baseclass. This allows the CoreText font engine to correctly report the minimum left/right bearings, which decreases the chance that an optimization in QTextLayout's line breaking algorithm will produce wrong results. The calculation of left and right bearing has been moved to the glyph_metrics_t type to reduce code duplication. This allows us to use the with and height of the bounding box to determine if the glyph has any contours. Change-Id: I864697d3f31ed56f22f04666199b6c5023c5e585 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-264-83/+222
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
| * Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Oswald Buddenhagen2015-08-123-57/+167
| |\
| | * Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-173-57/+167
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/manifest-meta.qdocconf src/corelib/global/qnamespace.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qtools_p.h src/sql/drivers/psql/qsql_psql.cpp Change-Id: I23a15ac84e03ad61d865e3df872b013eb0752949
| | | * Better handling of invalid font tables5.4Eskil Abrahamsen Blomfeldt2015-07-103-57/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically when reading files with broken cmap tables, we could get some undeterministic results. We handle this more gracefully by verifying that the offsets are sane and bailing out early if not. This replaces the current pattern throughout the font engine for consistency. Change-Id: I507bba49c0be634afca77d1eb3d199a427451bee Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Check for integer overflows in places where qAllocMore is usedMikhail Lappo2015-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-41230 Change-Id: Ic2167364e326092482657f2d2b4ab6ad3e5af631 (partially cherry-picked from 880986be2357a1f80827d038d770dc2f80300201) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Improve readability of QTextLine's handling of (negative) right bearingTor Arne Vestbø2015-08-071-26/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Helper functions in LineBreakHelper have been renamed from adjustFoo to calculateFoo, to signal that they do work, and are not adjusting something relative to something else. - The use of QFixed(1) and >= 0 has been replaced with an explicit constant for the case of the bearing not being calculated yet. - A helper function negativeRightBearing() has been added that returns the absolute value of any negative right bearing, making the width computations simpler. - Comments have been added and rewritten to make the logic clearer. Change-Id: I1d3a0214cfa8b4fed4551f3444b43a37d55bd69b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | | OSX FreeType: Add support for sub pixel font rendering.Sérgio Martins2015-08-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-42839 Change-Id: Iea4552d766936a55fd177e4287591d2715202d9c Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | Move setter for QFont::HintingPreference to QFontEngineFT.Andreas Hartmetz2015-08-142-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparation for also using it from QCoreTextFontDatabase. Change-Id: I9cbef59c21f343a88a5cb3fdbee1ed4791d7a36e Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | OSX: Add initial FreeType supportMathias Hasselmann2015-08-111-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This permits text rendering consistent with other FreeType enabled platforms, like Windows and Linux. Task-number: QTBUG-42839 Change-Id: I8c99bcaa3fb07c16e935a0c3705af467bc3da584 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | | Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-065-36/+85
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * | | Don't expose qt_setQtEnableTestFont(bool) by defaultKonstantin Ritt2015-07-311-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build it only in -developer-build mode for tests that might depend on exact-matching font behavior. Return earlier to avoid doing any useless job. Change-Id: I966ee5689f03403e45f4c957b63e3113f0467803 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * | | Default implementation for QPlatformFontDatabase::fallbacksForFamily()Konstantin Ritt2015-07-312-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...mainly for platforms that do not provide a native/unified way to obtain system-defined font fallbacks list (ie !CoreText && !FontConfig). Change-Id: I23c5589d79ddecb6311ccc52ec8b29977f06d408 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * | | [QFontDatabase] Defer the fallback families list initializationKonstantin Ritt2015-07-312-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the same trick the WebKit related path has used for years: if there is no explicit list that takes a precedence over the default one (i.e. QFont("Arial,SimHei")), then defer the fallback families list initialization until it gets requested. Change-Id: If5a74294bdebb24865c619bc0d7328b3e706de76 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * | | Doc:added doc to undocumented functionsNico Vertriest2015-07-222-2/+6
| |/ / | | | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: Ic358682b276d67ef804f727bcf14191718613469 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | | Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-302-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Work around QPaintDevice::metric's int return type by adding a new metric that returns a scaled devicePixelRatio. Choose a scale factor that gives us more than enough range. The QPaintDevice::devicePixelRatio() convenience accessor is public API and can unfortunately not be changed to return a qreal. Add devicePixelRatioF() which returns the (unscaled) devicePixelRatio. Change all call sites of QPaintDevice::devicePixelRatio() to use QPainDevice::devicePixelRatioF(). Task-number: QTBUG-46615 Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Fix qHash(QFontEngine::FaceId)Marc Mutz2015-07-231-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two problems: 1. qHash() hashed FaceId::uuid, but op== didn't use it for determining equality. Thus, x == y => qHash(x) == qHash(y) might be broken if fileName and uuid have an orthogonal component, if you excuse my vector analogy. 2. To hash fileName and uuid, it concatenated the two, causing a temporary QByteArray to be created just for hashing its contents. That prevented marking qHash() as nothrow. Fix by using new QtPrivate::QHashCombine and adding uuid to the list of fields compared in op==. Change-Id: I49f2379d514d6d3669929e737562cf6de823127e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | | Clarified the documentation for QTextDocument::find.Kavindra Palaraja2015-07-221-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTextDocument::find has a behavior that is different from the typical QRegExp/QRegularExpression behavior where finding a given expression is always constrained by the paragraph (block), regardless of newline characters in the expression. Task-number: QTBUG-21785 Change-Id: Ia6a061c6feb5a19e6b8caa3d8009da5ca31ec422 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | QtGui: Pass types with copy-ctor or dtor by const-refSérgio Martins2015-07-193-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... except if the function is a ctor, callers pass rvalues, and the type has a fast move ctor. In that case, keep passing by-value and qMove() into place. Change-Id: I2c0be7d4436327834ddee0531c51c5af352ac74c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QZip*: return FileInfo by valueMarc Mutz2015-07-191-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Makes for much more readable callers, and, d/t NRVO, isn't less efficient than the old code, either. Transparently enables moves when QVector should get them, at some point, too. Change-Id: I77327cf665272b80277deaaa6dd2ee9c00806464 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QZip*: don't hold QZipReader::FileInfo in QListMarc Mutz2015-07-192-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FileInfo is larger than a void*, so holding them in a QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Change-Id: I772177c5ac544a5fecce2368f628148308ef260f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Clean up QZipReader::FileInfoMarc Mutz2015-07-192-39/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - don't define special member functions if the compiler-generated ones are just fine (inhibits move semantics) - implement all remaining methods inline - unexport - remove unused (and, to add insult to injury, never init'ed) d-pointer. This is private API. No need for a d-pointer, much less an unused one. Change-Id: I6979cb5103a361c0313c252d3bf7073a3c47addd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Fix nullptr literal 0s which would look odd as nullptrMarc Mutz2015-07-191-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These all invoke the QFlags<>(Zero *) ctor, which is designed to accept a 0, but no other int. But in doing so, it requires passing a nullptr literal, and 0 is not a nullptr literal accepted under -Wzero-as-null-pointer-constant or similar warnings. Fix by using the QFlags::QFlags() ctor instead. Task-number: QTBUG-45291 Change-Id: I73f9c9f4de11eeb1ba04ace6c7121d17510ea29f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QtGui: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-196-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I72ab40b21a9499b53a639564fa45884de17b6c98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-07-171-1/+1
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe