summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextformat.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix qdoc warningsFriedemann Kleint2019-09-101-0/+1
| | | | | | | | | | | | | src/corelib/global/qnamespace.qdoc:3279: (qdoc) warning: Can't link to 'QGuiApplication::setHighDdpiScaleFactorRoundingPolicy()' src/corelib/time/qislamiccivilcalendar.cpp:49: (qdoc) warning: Can't link to 'QJijriCalendar' src/network/ssl/qsslsocket.cpp:1510: (qdoc) warning: Can't link to 'QSslConfiguration::defaultCaCertificates()' src/network/access/qhttp2configuration.cpp:49: (qdoc) warning: '\brief' statement does not end with a full stop. src/gui/text/qtextformat.cpp:532: (qdoc) warning: Undocumented enum item 'TableBorderCollapse' in QTextFormat::Property src/gui/text/qtextdocument.cpp:2066: (qdoc) warning: Undocumented enum item 'UnknownResource' in QTextDocument::ResourceType src/gui/kernel/qguiapplication.cpp:3500: (qdoc) warning: Undocumented parameter 'policy' in QGuiApplication::setHighDpiScaleFactorRoundingPolicy() Change-Id: I3573ef98cf9b58d16525c356270fe009fdffcf45 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QTextDocument: allow css-styling of table cell bordersNils Jeisecke2019-08-081-0/+279
| | | | | | | | | | | | | | | | | | | | This allows to set the width, style and color of each table cell's edge (left, right, top, bottom). Setting the table's border-collapse mode will disable explicit cell spacing. The basic CSS border collision rules are applied (wider border wins, vertical over horizontal). Setting the table's border width to a value >= 1 and enabling borderCollapse will now draw a simple and clean table grid (1px) with an outer border of the specified width and color. [ChangeLog][QtGui][QTextDocument] Added CSS style table cell border formatting with border-collapse mode. Change-Id: I324d82284802df4c88c13c5b902fec1f4768b67e Fixes: QTBUG-36152 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QTextMarkdownWriter: write fenced code blocks with language declarationShawn Rutledge2019-06-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MD4C now makes it possible to detect indented and fenced code blocks: https://github.com/mity/md4c/issues/81 Fenced code blocks have the advantages of being easier to write by hand, and having an "info string" following the opening fence, which is commonly used to declare the language. Also, the HTML parser now recognizes tags of the form <pre class="language-foo"> which is one convention for declaring the programming language (as opposed to human language, for which the lang attribute would be used): https://stackoverflow.com/questions/5134242/semantics-standards-and-using-the-lang-attribute-for-source-code-in-markup So it's possible to read HTML and write markdown without losing this information. It's also possible to read markdown with any type of code block: fenced with ``` or ~~~, or indented, and rewrite it the same way. Change-Id: I33c2bf7d7b66c8f3ba5bdd41ab32572f09349c47 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Markdown and HTML: support image alt text and titleShawn Rutledge2019-06-011-1/+7
| | | | | | | | | | | | | | | | | | | | | It's a required CommonMark feature: https://spec.commonmark.org/0.29/#images and alt text is also required in HTML: https://www.w3.org/wiki/Html/Elements/img#Requirements_for_providing_text_to_act_as_an_alternative_for_images Now we are able to read these attributes from either html or markdown and rewrite either an html or markdown document that preserves them. This patch does not add viewing or editing support in QTextEdit etc. Change-Id: I51307389f8f9fc00809808390e583a83111a7b33 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Add documentation for the QTextBlockFormat::marker propertyShawn Rutledge2019-05-231-0/+44
| | | | | | | Amends 65314b6ce88cdbb28a22be0cab9856ec9bc9604b. Change-Id: I8f69030accb948055b0081f8a4f1daafbac824ce Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix qdoc warnings for Qt 5.14Friedemann Kleint2019-05-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/tools/qstring.cpp:9505:clang found diagnostics parsing \fn int QLatin1String::indexOf(QLatin1String l1, int from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QLatin1String' src/corelib/tools/qstringview.cpp:723:clang found diagnostics parsing \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QStringView' src/corelib/tools/qstringview.cpp:822:Unknown command '\t' src/corelib/tools/qstringview.cpp:825:Unknown command '\t' src/corelib/tools/qstringview.cpp:826:Unknown command '\t' src/corelib/tools/qstringview.cpp:831:Unknown command '\t' src/corelib/global/qnamespace.qdoc:2448:Undocumented enum item 'MarkdownText' in Qt::TextFormat src/corelib/tools/qstringmatcher.cpp:183:No such parameter 'pattern' in QStringMatcher::QStringMatcher() src/network/ssl/qsslerror.cpp:58:Undocumented enum item 'CertificateStatusUnknown' in QSslError::SslError src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screenOrientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screen' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:No such parameter 'orientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockCodeLanguage' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockQuoteLevel' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockMarker' in QTextFormat::Property src/gui/text/qtextdocument.cpp:3294:Undocumented parameter 'features' in QTextDocument::toMarkdown() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace2' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace2' in QColorSpace::operator!=() examples/widgets/doc/src/icons.qdoc:269:Command '\snippet (//! [43])' failed at end of file 'widgets/icons/iconpreviewarea.cpp' src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogRetryButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogYesToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogIgnoreButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogNoToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogAbortButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_RestoreDefaultsButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogSaveAllButton' in QStyle::StandardPixmap src/testlib/qtestcase.qdoc:439:Undocumented parameter 'TestClass' in QTest::QTEST_HIGHDPI_SCALING_MAIN src/testlib/qtestcase.qdoc:452:Undocumented parameter 'TestClass' in QTest::QTEST_NO_HIGHDPI_SCALING_MAIN Change-Id: Ib0e9bf81c5caaa6b1fc644ac92085af47c600e0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix some qdoc warningsFriedemann Kleint2019-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | src/corelib/itemmodels/qtransposeproxymodel.cpp:166: (qdoc) warning: Unknown command '\details' src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:102: (qdoc) warning: '\brief' statement does not end with a full stop. src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:233: (qdoc) warning: Undocumented parameter 'index' in QConcatenateTablesProxyModel::flags() src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:165: (qdoc) warning: Undocumented parameter 'proxyIndex' in QConcatenateTablesProxyModel::mapToSource() src/corelib/io/qresource.cpp:275: (qdoc) warning: Can't link to 'isCopressed()' src/corelib/io/qresource.cpp:555: (qdoc) warning: Can't link to 'compressionType()' src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: '\brief' statement does not end with a full stop. src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: Can't link to 'QSslSocket::ocspResponse()' src/gui/image/qimage.cpp:2247: (qdoc) warning: Undocumented parameter 'f' in QImage::convertTo() src/gui/image/qimage.cpp:2247: (qdoc) warning: No such parameter 'format' in QImage::convertTo() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: Undocumented parameter 'styleName' in QTextCharFormat::setFontStyleName() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: No such parameter 'style' in QTextCharFormat::setFontStyleName() src/widgets/dialogs/qdialog.cpp:151: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:168: (qdoc) warning: Unknown command '\p' Change-Id: Ide52b70f8e72d53767d489ce1a413cf4c2dce7df Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QtGui/Text: mark obsolete functions as deprecatedChristian Ehrlicher2019-01-281-0/+4
| | | | | | | | | | | Mark some long obsolete functions as deprecated so the can be removed with Qt6: - QTextFormat::setAnchorName()/anchorName() - QTextList::isEmpty() Change-Id: Ic1f5317980d116c846def3645d2a6cd61ba8679d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support style name property in QTextCharFormatEskil Abrahamsen Blomfeldt2018-12-041-0/+25
| | | | | | | | | | | | | | | | The support for setting the style name in the QTextDocument API was never added, as revealed by the example in the linked bug report. The actual bug reported there (style names not working with some Helvetica Neue) is not reproducible anymore. [ChangeLog][QtGui][Text] Added support for setting the font's style name in QTextCharFormat. Task-number: QTBUG-22813 Change-Id: I8f4d12151c3611aa30965fd963bc93f7c4264e23 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-1/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * Doc: Qt GUI: Fix documentation warningsTopi Reinio2018-11-061-1/+2
| | | | | | | | | | | | | | | | | | These are minor typos or documentation warnings that snuck in with new features. Task-number: QTBUG-71502 Change-Id: I03669cfecc3c3d80168ff7b1ca8bca7571e06d25 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Handle fonts that have commas/quotes in the family nameAndy Shaw2018-11-081-0/+23
|/ | | | | | | | | | | | | | | | | | | | | | | | Since the comma character was originally used as a separator, we need to extend QFont to have setFamilies() so that we can avoid joining the family strings together. This enables us to see the family name as a single string and for multiple family names, we have families(). Subsequently, this has added functions to QTextCharFormat to account for multiple font families too. So it is now possible to set a single one directly with setFontFamily() and multiple ones with setFontFamilies(). This also bumps up the datastream version to 19 as QFont now streams the families list as well. [ChangeLog][QtGui][QFont] Add setFamilies()/families() to aid using of font families with commas and quotes in their name. [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 19 to account for changes in the serialization of QFont. Fixes: QTBUG-46322 Change-Id: Iee9f715e47544a7a705c7f36401aba216a7d42b0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add image quality handling to QTextImageFormatDaniel Savi2018-04-221-1/+24
| | | | | | | | | | | | | | | | This patch enhances QTextImageFormat with a property for image quality. Default will be quality of 100. The user may set different values with setQuality(int). QTextODFexport will export images as png if quality is set to 100 and as jpg with the compression quality set to the given value if smaller than 100. [ChangeLog][QtGui][QTextImageFormat] Adds two new functions to the class: setQuality(int=100) and quality(). Is currently used by QTextODFWriter to determine the image type and quality when exporting images to ODT files. Change-Id: Iaa8ec0246aaba004d98c9e8c66609795101519a9 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Document the QTextBlockFormat::headingLevel propertyShawn Rutledge2018-03-291-0/+30
| | | | | | | | Followup to 310daae53926628f80c08e4415b94b90ad525c8f Change-Id: Ib0b4330e2201991fa28b297e26edb3a8dd493577 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* qdoc: properly omit comments for enums marked with omitvalueChristian Ehrlicher2018-03-271-1/+1
| | | | | | | | | | When a value is omitted with \omitvalue, the comment must be either deleted or omitted with \omit .. \endomit. Otherwise the comment is merged into the comment for the previous value Change-Id: Ic5cfb20d36853526ae939529b4609712cd0eb341 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Add missing return types to \fn commandsMartin Smith2018-01-181-13/+13
| | | | | | | | | Added void return type to several \fn commands. The return type should always be included with the \fn command in clang-qdoc. Change-Id: Ie751eb1430eff668f33f8d86e0b1454bd1d2f582 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update font when text format's letter spacing type is changedEskil Abrahamsen Blomfeldt2017-12-221-2/+6
| | | | | | | | | | | | | | | | | | | The QTextFormat::FontLetterSpacingType property was added outside the span of the FirstFontProperty and LastFontProperty, so the fontDirty flag would not be set when it was changed. There is no binary compatible way to fix this before Qt 6, so for now, we add a special case for it. [ChangeLog][QtGui][Text] Fixed an issue where changing the letter spacing type of a QTextCharFormat would not cause its font to update. Task-number: QTBUG-65345 Change-Id: I5ab53d7f82d529b57edceacfc3fa688c6741cd17 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: C. Boemann <cbo@boemann.dk> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix implementation of spell check underline stylesDmitry Shachnev2017-10-211-3/+3
| | | | | | | | | | | | | | | | | | | The QTextCharFormat documentation said that the used style is based on QStyle::SH_SpellCheckUnderlineStyle style hint, however in fact the implementation (drawTextItemDecoration in qpainter.cpp) uses themeHint(QPlatformTheme::SpellCheckUnderlineStyle) instead since Qt 5 (see commit 1f9ae50457a3750f). Make the documentation match that behavior, and update QPlatformTheme to use the correct default value. Also, switch Cocoa theme to use DotLine, as that is what native macOS applications use. Change-Id: I2a6bb3da6c7b0686dca87ed2c251b6abc006123c Task-number: QTBUG-50499 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Fix uninitialized membersJesus Fernandez2017-06-201-1/+1
| | | | | | | | | CID 181185: Uninitialized members (UNINIT_CTOR) Non-static class member "key" is not initialized in this constructor nor in any functions that it calls. Change-Id: I8f2c18263a0dc81b98eb398d618184bf761c02e1 Coverity-Id: 181185 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QTextFormatPrivate::Property out of the classThiago Macieira2017-06-131-17/+17
| | | | | | | | | | | This allows us to have the Q_DECLARE_PROPERTY before the QVector<Property> use. Not important for Qt 5, but it helps me. The operator!= function is never called, so it can be dropped (caught by ICC 17 beta). Change-Id: I149e0540c00745fe8119fffd1463c9bc1b356ec6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTextFormatCollection: replace copy ctor and op= with clear()David Faure2017-02-231-12/+5
| | | | | | | | | | | | | | | | | operator=, which was only used for clearing, wasn't clearing the hash. This led to a mismatch between the vector and the hash (given that the hash points into the vector). Spotted by interrupting kmail in gdb, and it was in this code iterating over a 2000 entries hash (the first vector entries not matching the hash, this code keep appending new entries for the same formats). This fixes QTBUG-8862 again, the initial fix having been accidentally reverted in 467b15a. Change-Id: Ia34b3d002a0199e1930431a4bbdb2ec981ed4ffc Task-number: QTBUG-8862 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Improve use of QHash to minimize double hashingAllan Sandfeld Jensen2016-11-101-2/+1
| | | | | | | | Avoid looking up by key twice in a row in various locations, but instead using iterators and index lookup. Change-Id: I61a079115199ab9c041ad3a26d36b45ee3f775e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/io/qsettings.cpp src/corelib/itemmodels/qstringlistmodel.cpp tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
| * Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-061-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| * Fix bugs causing Thin font weights to be ignored or mishandled.Jake Petroules2016-06-011-3/+4
| | | | | | | | | | | | Task-number: QTBUG-53196 Change-Id: If12b3cab3d8de5e0e452fca844b0a484c29e9e86 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Gui: use const (and const APIs) moreAnton Kudryavtsev2016-06-011-1/+1
| | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I88d08d499e1be72c1f6d983fecdcee513df18aa2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QtGui: mark some more types as movable/primitiveMarc Mutz2016-03-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | These are already held in QVectors. Public API types need to wait until Qt 6, for BC reasons. Even though Q_RELOCATABLE_TYPE deals with most of them, we lack a way to mark a type as primitive, but still isStatic - for QList. Change-Id: I91392b01ae6f94cc847007636e12d4e64c43b2bc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | gui: Add several QList::reserve() calls.Sérgio Martins2015-06-221-1/+5
| | | | | | | | | | | | | | Reduces reallocations. Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Improve QTextDocument::toPlainText doc related to inline imagesAlessandro Portale2015-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | "Embedded objects, such as images, are represented by a Unicode value U+FFFC (OBJECT REPLACEMENT CHARACTER)." Also updated the QTextImageFormat docs with the same wording. Task-number: QTBUG-44538 Change-Id: I64dd5f5be4a0ecc64b30758a72f8b4281c17924b Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Replace <qhash.h> with <qhashfunctions.h> where applicableMarc Mutz2015-04-201-1/+1
|/ | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: Ic3398f4f330e15a3b55065858add26b90fd70e6c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Use QDebugStateSaver to restore space setting in stream operators.Friedemann Kleint2015-03-301-2/+4
| | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * QTextCharFormat: fix word spacing setupMaks Naumov2015-01-231-1/+1
| | | | | | | | | | | | | | | | Properly check QFont::WordSpacingResolved when use setFont() with QTextCharFormat::FontPropertiesSpecifiedOnly Change-Id: I72f1641ef7587cbaf8fcf5fef2f3c44393b0ebfc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * Doc: fix copy/paste error in QTextCharFormat::setFont documentationDavid Faure2015-01-221-1/+1
| | | | | | | | | | Change-Id: I2190975762c6283daa004b754da607829d263b0a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-211-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * QTextFormat: fix undefined behaviorMarc Mutz2015-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Left-shifting of negative values is undefined ([expr.shift]/2). Since hashValue is a uint already, rectify by casting it->key to uint prior to shifting. Found by UBSan. Change-Id: I94a5311f5a4492f514f595b8fb79726df1e7d0de Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | QTextFormat: use qHash(double/float) instead of own implementationMarc Mutz2014-09-021-17/+3
|/ | | | | | | | | | | | | | | | The implementation of hash(float) does not treat +0 and -0 the same, thus violating the property required of hash functions that they produce equal hash values for equal input. Simply use the qHash() FP functions which recently became available and which do not have that problem. This was found by unrelated code review. I'm not aware of any user- visible issue this fixes. Change-Id: I458c384aaf112e29cea677022969b62a34263cfb Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Remove TableFormat as FormatType from QTextFormatLars Knoll2014-02-061-1/+1
| | | | | | | | | | The enum value is unused, a QTextTableFormat is actually documented to have a FormatType of FrameFormat, and isTableFormat() etc. do the right thing. Task-number: QTBUG-35114 Change-Id: I2f3305630b92f117c1f89b85460457265e5af126 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allow QTextCharFormat::setFont() to skip unresolved font propsKonstantin Ritt2014-01-311-23/+80
| | | | | | | | | This makes the font merging possible and solves an issue with the default font properties inheritance when used in conjunction with QTextFormatCollection. Change-Id: If8b543c011122dde9f086f5d696df3b042f7b90c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Reduce code duplicationKonstantin Ritt2014-01-201-13/+0
| | | | | Change-Id: I077963fcb910fa705b087e35e99cd07436c034b1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add convenience method QTextFormat::isEmpty()Konstantin Ritt2014-01-201-0/+9
| | | | | Change-Id: I30e74de6853908d1fec399131637848e3c2faabe Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-46/+46
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>