summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * Fix ambiguous overload call on OS XThiago Macieira2015-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by ICC: qtextengine.cpp(1259): error: more than one instance of constructor "QFixed::QFixed" matches the argument list: function "QFixed::QFixed(int)" function "QFixed::QFixed(long)" function "QFixed::QFixed(qreal={double})" argument types are: (uint) QFixed stretch = QFixed(actualFontEngine->fontDef.stretch) / QFixed(100); ^ Change-Id: I790fb4cae1abc692705253a7863291bc8743b832 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* | QPlatformFontDatabase: compress an array of ushortsMarc Mutz2015-07-161-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | First, all values in the array fit into 8-bit, so change the type from ushort to quint8. Then, instead of appending a zero as end marker, statically determine the size of the array and use that number. Also fixes (benign) off-by-one error in the existing reserve() call. Change-Id: Id05b6a56b55d2e0769b00496a55808bb7351b084 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QTextEngine: don't hold ItemDecoration in QListMarc Mutz2015-07-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | ItemDecoration is larger than a void*, so holding it in QLists 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. Fix by marking the type movable and holding in QVector instead. Change-Id: I06d7a77529f7cff2ba503c5e8d6e5df0ad801a21 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QPlatformFontDatabase: compress requiredUnicodeBits tableMarc Mutz2015-07-131-1/+1
| | | | | | | | | | | | | | | | | | All values in the table fit into 8 bits, so don't use a 16-bit type. Change-Id: I685727e16a264a49ea501d36eb6815c6d5aaa9b2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Fix some qdoc-warnings.Friedemann Kleint2015-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/io/qdatastream.cpp:501: warning: Undocumented enum item 'Qt_5_6' in QDataStream::Version qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp:1764: warning: Undocumented parameter 'model' in QItemSelectionModel::setModel() qtbase/src/corelib/statemachine/qabstractstate.cpp:216: warning: Undocumented parameter 'active' in QAbstractState::activeChanged() qtbase/src/corelib/statemachine/qstatemachine.cpp:3262: warning: Undocumented parameter 'running' in QStateMachine::runningChanged() qtbase/src/corelib/tools/qchar.cpp:160: warning: Undocumented enum item 'Unicode_7_0' in QChar::UnicodeVersion qtbase/src/gui/image/qimagereader.cpp:1168: warning: Undocumented parameter 'enabled' in QImageReader::setAutoTransform() qtbase/src/gui/image/qimagewriter.cpp:621: warning: Undocumented parameter 'transform' in QImageWriter::setTransformation() qtbase/src/gui/itemmodels/qstandarditemmodel.cpp:1268: warning: Undocumented parameter 'tristate' in QStandardItem::setAutoTristate() qtbase/src/gui/kernel/qscreen.cpp:590: warning: Undocumented parameter 'orientation' in QScreen::orientationChanged() qtbase/src/gui/kernel/qscreen.cpp:599: warning: Undocumented parameter 'orientation' in QScreen::primaryOrientationChanged() qtbase/src/gui/text/qtextdocument.cpp:1455: warning: No such parameter 'from' in QTextDocument::find() qtbase/src/gui/text/qtextdocument.cpp:533: warning: Undocumented parameter 'option' in QTextDocument::setDefaultTextOption() qtbase/src/widgets/itemviews/qtableview.cpp:2546: warning: Undocumented parameter 'enable' in QTableView::setSortingEnabled() qtbase/src/widgets/statemachine/qkeyeventtransition.cpp:119: warning: Undocumented parameter 'key' in QKeyEventTransition::setKey() qtbase/src/widgets/widgets/qplaintextedit.cpp:1610: warning: Can't link to 'toText()' qtbase/src/opengl/qgl.cpp:4371: warning: No documentation for 'QGLWidget::event()' Remove the documentation as they are properties: qtbase/src/widgets/widgets/qfontcombobox.cpp:407: warning: Undocumented parameter 'font' in QFontComboBox::setCurrentFont() qtbase/src/widgets/widgets/qfontcombobox.cpp:403: warning: Undocumented parameter 'script' in QFontComboBox::setWritingSystem() Change-Id: If599a3ce747bbb8a3418dd973810923b87246371 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | qdoc:Fixed a few qdoc errorsMartin Smith2015-07-071-0/+14
| | | | | | | | | | | | | | | | | | Fixed a few qdoc error messages caused by errors in qmetatype.cpp and qtextlayout.cpp and qtestcase.cpp and qpointer.cpp Change-Id: I662aa25bedba057e125e289c34787e81793941ff Task-number: QTBUG-46939 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | QTextLayout: deprecate QList API for additionalFormatMarc Mutz2015-07-042-11/+14
| | | | | | | | | | | | | | | | | | This is a separate commit to allow other modules to do the transition before this may vanish or cause a warning. Change-Id: I556837bf0d2c667f067f4e1fa7918bd1a3f55025 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-019-121/+137
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Replace MAC OS X with OS XNico Vertriest2015-06-303-4/+4
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * [QZip] Do not depend on platform definitionsKonstantin Ritt2015-06-271-85/+98
| | | | | | | | | | | | | | | | | | | | | | | | Guarantee the values are exactly the same on all platforms and avoid the macro redefinition(s) on a newer MinGW. This also fixes a typo in #define S_IFLNK 020000 (<-- must be 0120000). Change-Id: I4993d2a9bdb4b0871af110b89c137ce0ac0e953a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * Treat color (ARGB) glyphs, e.g. Emoji, as having unreliable glyph outlinesTor Arne Vestbø2015-06-261-5/+5
| | | | | | | | | | | | | | | | | | | | This is used by the scene graph to automatically switch over from distance field text to native text rendering for the given glyph node, which allows mixing regular text with Emoji in e.g. a Text item without having to set renderType to Text.NativeRendering. Change-Id: I5d96d1dab329a975e3442284bf4c5a82174177c9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * Simplify permission flag handling a bitKonstantin Ritt2015-06-251-18/+6
| | | | | | | | | | | | Change-Id: I753f7a398c39e7300821658f27e4813c591eebc3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * [QFontMetrics] Mark obsolete charWidth() method for deletion in 6.0Konstantin Ritt2015-06-252-1/+5
| | | | | | | | | | | | | | | | It was obsoleted for quite a while already and we forgot to get rid of it the last time. Change-Id: Ib15e71829e80648aa667a6b0af31698460b99cc1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * Extend generated style strings to include new font weightsAllan Sandfeld Jensen2015-06-151-9/+20
| | | | | | | | | | | | | | | | | | | | | | When a font style-name is not directly available from the font we need to generate it with the data we have, so we should include all the new supported weights. Change-Id: I45cc0114f8c76f45bc7a639f9d0d8096a064bc51 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com> Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
| * Font definitions with different style names are not equalAllan Sandfeld Jensen2015-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since we added font matching by style name, the style name is not just a derived property and should not be ignored in comparisons. The QFontDef::exactMatch comparison is left unchanged, since it tests if a loaded font matches a requested one. Task-number: QTBUG-30851 Change-Id: I4187c5b993815001f35bcf24dc449059bfdcba6f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QtGui: make all Q_DECLARE_SHARED types nothrow move-assignableMarc Mutz2015-06-304-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Excepting QBitmap and the QTextFormat heirarchy, which don't have 100% value semantics (still pondering them). In QPolygon(F), adding the move assignment operator disables the implicitly-defined copy assignment operator, which therefore have to be made user-defined. That doesn't change the ABI of the class, since the base class QVector already had a user-defined copy assignment operator. Change-Id: I0b111c1d21cf47f559ada6357c982e3dc26aca68 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QZip*: mark various types movable and primitiveMarc Mutz2015-06-242-0/+10
| | | | | | | | | | | | | | | | ... even if they are not (currently) held in Qt containers (though FileInfo is). Change-Id: Id14d4af89fed8bcefdbb9b28d11c1c43fccf7190 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | gui: Add several QList::reserve() calls.Sérgio Martins2015-06-227-11/+18
| | | | | | | | | | | | | | Reduces reallocations. Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QTextDocumentLayout: don't hold QPointers in QListMarc Mutz2015-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | QPointer 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: I104d11cc530c9c1579e82bf4e28e3353c00b34b4 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QFontSubset: mark local types movable and hold in QVector, not QListMarc Mutz2015-06-202-19/+24
| | | | | | | | | | | | | | | | Virtually all of these types are too large to fit into a QList. Change-Id: If55496ef3fb26d6531e9ef1bb1558887d9077a3b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Remove quadratic behavior in QFontDatabase::writingSystems()Marc Mutz2015-06-191-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looping over QList::contains() constitutes O(N²) behavior, the more so as this QList is horribly inefficient since WritingSystem is not a Q_MOVABLE_TYPE. Since the range of possible unique values in the result is severly limited (by virtue of being enumerated values), use a bitmask to remember which WritingSystems were encountered, then, after releaseing the mutex again, use that bitmask to populate the QList. Change-Id: I1d12eb487513ec17faa6f38942f8b681819dc0e8 Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | doc: Remove uses of \mainclassMartin Smith2015-06-053-3/+0
| | | | | | | | | | | | | | | | This qdoc command is deprecated. Task-number: QTBUG-46476 Change-Id: Iee36f91bdcf500c2e88022a5f8a9c3accc6048c2 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devSimon Hausmann2015-06-0410-60/+39
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-0310-60/+39
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| | * Don't assign iterator to const_iteratorSérgio Martins2015-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It should also be possible to use QT_STRICT_ITERATORS in Qt's own code base Change-Id: I0914db480d4d2b06e71e3a2588163efdd3ff6d27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Better match thin font stylesAllan Sandfeld Jensen2015-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | A style name 'Extra Thin' or 'Thin Italic' should be parsed as Thin font weight. Change-Id: I8acebed7330c23231b3742d887081d8b3d0aeb19 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * Fix overcaching the fallback families list for a requested familyKonstantin Ritt2015-05-131-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cached list didn't take fontStyle, styleHint and script into account. As long as QFontCache isn't explicitly disabled, loadEngine() rarely called for the same family, foundry, style and size - so avoid caching anything here at all. Change-Id: I7779bf33fc074edc00799f9a39d67327f8c88ccc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Simplify QFontDatabase::findFont()Konstantin Ritt2015-05-133-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontDatabase::load() is the only caller that passes non-null QFontPrivate* to QFontDatabase::findFont(), to adjust the pointSize with regards to the font's dpi; do that right in QFontDatabase::load(). The `multi` param's meaning is, in fact, an absence of the QFont::NoFontMerging flag, so prefer the latter and prevent ambiguity in the future. Change-Id: Icc7751044e454ca438e7627364faa415287bf1ae Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | * [QFontDatabase::findFont] Get rid of the refactoring leftoversKonstantin Ritt2015-05-131-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | The logic this code was aimed for has been covered by a more complete solution in QFontDatabase::load() years ago; simply drop the dead code. Change-Id: Id8860353ff4f4d2f1529aa89810d6c5725e97d24 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | * QTextTable/QTextDocumentLayout: remove dead codeDavid Faure2015-05-062-8/+0
| | | | | | | | | | | | | | | Change-Id: I3eb72a43129c58574036b6ca8c8c8413ca24b43a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * Make data tables const.Volker Krause2015-05-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves some of them to the .rodata section, the rest at least to .data.rel.ro[.local]. Change-Id: I85676ddf22b0c0097f3f0dce4c3dc018dc29d045 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| | * Add noexcept to move constructors and assignment operatorsAllan Sandfeld Jensen2015-05-042-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the noexcept attribute to all move constructors and assignment operators in QtGui that didn't already have it. Change-Id: Idcdf79ae8349b8793e7394b5ae7c08e6111fbc9a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | De-duplicate vtables, part II: exported public classesMarc Mutz2015-06-032-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. In this second and last batch, we de-inline destructors of exported public classes. Since they are already exported, users of these classes are unaffected by the change, but since it's public API, and the dtors may have been de-virtualized and inlined into application code, we need to avoid adding code to the out-of-line destructor until Qt 6. Change-Id: Ieda9553cb4b0dae7217c37cc7cde321dd7302122 Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QStaticTextUserData: declare dtor out-of-line and export classMarc Mutz2015-06-032-2/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | De-duplicates vtables and enables RTTI on this class hierarchy. Export, as QOpenGLStaticTextUserData (QtOpenGL) inherits it. Change-Id: I0662870538c35f23baf6bde4594ec8b9055efae7 Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QAbstractTextDocumentLayoutPrivate: declare dtor out-of-line and export classMarc Mutz2015-06-012-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | De-duplicates vtables and enables RTTI on this class hierarchy. Export, as QPlainTextDocumentLayoutPrivate (QtWidgets) inherits it. Change-Id: I8aee43b43898a72430d8bc1247ea76c7d4e9031d Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | src/gui/text/text.pri: add missing header qabstracttextdocumentlayout_p.hMarc Mutz2015-06-011-0/+1
| | | | | | | | | | | | Change-Id: Ia825ef6d932fbd45ceaf8c54a3207f207fa40994 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix users of QTextLayout::additionalFormats to use the new APIMarc Mutz2015-05-304-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | QTextLayout::additionalFormats setters and getters using QList<FormatRange> have been deprecated; port to the QVector versions. Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find it otherwise. Change-Id: Ibab6589df057f02377d895079b56395859e3401e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QTextLayout: replace a use of an inefficient QList with QVectorMarc Mutz2015-05-294-11/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QTextLayout::FormatRange is larger than void* and thus should not be held in QList. Use a QVector instead. Other parts of Qt already hold FormatRanges in QVectors, so this also makes handling FormatRanges more consistent. To avoid ugly names for the getter which doesn't overload on return type alone), rename the set of function to format (from additionalFormats). [ChangeLog][QtGui][QTextLayout] Added QVector-based alternatives setFormat(), format(), and clearFormat() to setAdditionalFormats(), additionalFormats(), and clearAdditionalFormats(), resp. Change-Id: Ie04a561b43c91c3b2befb3cac2981821f84d5f77 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Q*GlyphCache: de-inline dtor and export vtableMarc Mutz2015-05-263-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The destructor is the first virtual method. By not defining it out-of-line, we provoke multiple copies of vtables, not all of which can be merged by the linker. If the linker fails, RTTI such as dynamic_cast and catch-blocks involving the type will not work. Additionally, QFontEngineGlyphCache was not exported, and therefore also not its vtable, making it impossible for users outside of QtGui to get a unique RTTI for the class. Change-Id: Ib265945934216bb609629431eb4c71996d4fd39d Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-05-043-41/+11
|\| | | | | | | Change-Id: I487a4b7c05687a10c498ac219c31367d4db6fbc0
| * Fix undefined behavior in left-shifting into negativeThiago Macieira2015-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's undefined behavior to left or right-shift a signed integer such that the sign changes. Since SymbolCsbBit is 31, make sure we use unsigned numbers. Found by ICC qplatformfontdatabase.cpp(614): error #68: integer conversion resulted in a change of sign Change-Id: Idf715b895bac4d56b4afffff13da78d294b1248e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>