summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Skip 'off-by-one' adjustment in block length during undo operationSanthosh Kumar2023-12-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | The adjustment of block length with 'off-by-one' affects content length during undo operation. The issue occurs when we perform undo operation for a set of group blocks that have same fragment position. Since their positions are same, group block change (QTextDocumentPrivate::documentChange) with respect to insertion doesn't affect document block length and further adjustment to 'off-by-one' without considering this leads to incorrect document content change information (such as invalid information with regard to characters removed). This patch skips adjustment of group block length during undo operation. Amends 8fbedf2196a292fe2affcf83ddc846b9c852772a Fixes: QTBUG-113865 Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: I315dcf01ba5b2f4ed6d95e9d6910d82848374aef Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "QTextDocumentPrivate::plainText: simplify code"Mårten Nordheim2023-11-091-4/+8
| | | | | | | | | | This reverts commit a83a818791bc88725e07ea41b7c5fa50828e6b24. Reason for revert: It's causing asserts, solution to fix is unclear Change-Id: I33ef760a9402c096d3d7487e777c3ccdbb626d39 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTextDocumentPrivate::plainText: simplify codeAnton Kudryavtsev2023-10-121-8/+4
| | | | | | | | | Use QSV more to avoid manual memcpy Also port loop to range-based for Change-Id: I06f4b424853a4b3ee245c66ccc650d87740e2cb8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qtextdocument::insertText: port to QSVAnton Kudryavtsev2023-10-051-1/+1
| | | | | | | | and add QChar overload to reduce allocations Also port tests from char* literals to char16_t literals Change-Id: I99381a2da08d9d35e6135c48bd92bd8d72533065 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QTextDocumentPrivate: de-inline {add,remove}Cursor()Marc Mutz2022-12-271-0/+10
| | | | | | | | | | | | | | | | In a 'ninja qtdeclarative' build, the addCursor() function alone is compiled 458x for a total of almost 10s cumulative compilation time. This makes it one of the top-20 template instantiations in a Clang -ftime-trace build. The removeCursor() function doesn't show up quite as much, but de-inline, too, while we're at it. Pick-to: 6.5 Task-number: QTBUG-97601 Change-Id: I37b920a8b364861efab78f736d71642dc82d8982 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-7/+7
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add css media rule support for QTextDocument::setHtml()Ralf Habacker2021-12-151-1/+2
| | | | | | | | | | | | | | | | | CSS styles can contain '@media <rule> {...}' blocks, which were previously ignored for all values except "screen". To use a media rule other than the default "screen" rule, specify it before calling setHtml() with setMetaInformation() and the new info value 'CssMedia'. [ChangeLog][Gui][QTextDocument] Add css media rule support for QTextDocument::setHtml() Pick-to: 6.3 Fixes: QTBUG-98408 Change-Id: Ie05f815a6dedbd970210f467e26b116f6ee3b9ca Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QTextDocument: fix an off-by-one in the changed signal for listsEirik Aavitsland2021-11-291-1/+4
| | | | | | | | | | | | | | | | | When blocks are added or removed in block groups, i.e. items added or removed from text lists, the whole group is marked as changed, but the calculation of the before/after group length would be one off. That was reflected in the contentsChange signal. Add unit test. Since the whole group changes when list items are added, text is removed and the change-begin is not where the cursor was when the change was made. Fixes: QTBUG-82455 Pick-to: 6.2 5.15 Change-Id: I99ee2cfef4944fcac8aca492741fd0f3b0de4920 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* gui: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: Ie53e5542a8f93856470982939ecd8ec90b323d69 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Replace QTextDocumentResourceProvider with a std::functionVolker Hilsheimer2021-03-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | 376e3bd8ecf40881685714f6f19e12d68e92127e added the new class for Qt 6.1, but during header review we concluded that using a class introduces complexity wrt instance ownership and API design that can be avoided by using a std::function instead. The functionality is tied to QTextDocument, so the type definition and the default provider API is added there. Since std::function is not trivially copyable, the atomicity of the previous implementation is not maintained, and concurrent modifications of and access to the global default provider from multiple threads is not allowed. The relevant use case can be supported by implementing a resource provider that is thread safe. Task-number: QTBUG-90211 Fixes: QTBUG-92208 Pick-to: 6.1 Change-Id: I39215c5e51c7bd27f1dd29e1d9d908aecf754fb7 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Rename QUrlResourceProvider to QTextDocumentResourceProviderVolker Hilsheimer2021-03-291-1/+1
| | | | | | | | | | | | | | | | | While the class name is now a bit more than a mouthful, it's purpose is very narrowly tied to QTextDocument, so don't use a very generic name for it. That resources are provided based on a URL is to some degree an implementation detail, and URLs are resource locators so we don't need that in the class name. Address code review comment for 6.1. Add documentation and links to existing APIs with a similar purpose. Task-number: QTBUG-90211 Task-number: QTBUG-92208 Pick-to: 6.1 Change-Id: I4f09057cc2f53a5595513c1c9422e6ccaad6ca13 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Introduce QUrlResourceProvider to load resources for HTMLAlexander Volkov2021-01-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | QTextDocument and the text editor classes suggest to override their loadResource() methods to provide data associated with a text document. This approach has the following drawbacks: - it requires subclassing - there is no way to set a global resource provider - QLabel is missing virtual loadResource() method and it can't be added without breaking ABI QUrlResourceProvider is designed to solve these issues. One should create a derived class that implements QUrlResourceProvider::resource(). The objects of the derived class then can be set for any text document. The default resource provider can be set with QUrlResourceProvider::setDefaultProvider(). This change also adds QLabel::setResourceProvider(), which doesn't break ABI. [ChangeLog][QtGui][Text] Introduced QUrlResourceProvider that allows to load resources for HTML. It is intended to replace the use of QTextDocument::loadResource(). Change-Id: Iaf19b229f522a73508f20715257450fe58f68daf Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-311-1/+1
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use qsizetype in QListLars Knoll2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QtGui from QStringRef to QStringViewLars Knoll2020-06-111-5/+5
| | | | | | Task-number: QTBUG-84319 Change-Id: I1761096fbcc9421a013cf73f831a2a2ba0c18006 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-9/+9
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve QTextDocumentPrivate cursor performanceLangonda Agag2019-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cursors in QTextDocumentPrivate are held in a QList. This becomes a serious performance problem with lots of extra selections due to a call to QTextDocumentPrivate::removeCursor() from the QTextCursor destructor. Given the following test program: QPlainTextEdit *editor = ... std::list< QTextCursor> list; for(int i = 0; i < 100000; ++i) { QTextCursor c(editor->document()); c.setPosition(std::rand()%100); list.push_front(c); } list.clear(); // <-- clear calls hangs for 3+ seconds // due to time spent in // QTextDocumentPrivate::removeCursor() // due to QList::removeAll() call Note the push_front because it exacerbates the issue because the entire list will be traversed. The change submitted changes the structure to a set, removing the issue. In theory, this limits that a cursors cannot be in the structure twice, but this neither happens nor would it make sense. Change-Id: I817dc5d1bda1d98c6725a531b32d1c711a029a34 Reviewed-by: Langonda Agag <namezero@afim.info> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-131-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-121-2/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/arch/write_info.pri Repair architecture config test for the WASM_OBJECT_FILES=1 build mode configure.pri tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
| | * Fix crash in QTextDocument::clearUndoRedoStacks()Eskil Abrahamsen Blomfeldt2019-08-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling QTextDocument::clearUndoRedoStacks() with UndoStack, there were two bugs: The first was that we were retrieving the item at "undoState" and deleting this. This is actually the upper limit of the for loop. If the stack does not contain any redos, then it would be == undoStack.size() and we would assert. If there were redos, then we would delete the item at undoState multiple times (actually undoState times). In addition, when the loop exited, we first removed the dangling pointers using remove() and then there was a weird resize() to the new size minus the old undoState. This would either assert because we tried to resize to a negative number, or it would arbitrarily remove items from the stack. [ChangeLog][QtGui][Text] Fixed a crash bug in QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack). Task-number: QTBUG-69546 Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Use QScopedValueRollback more as a reentrancy guardAllan Sandfeld Jensen2019-03-261-8/+10
|/ / | | | | | | | | | | | | It is documented for the use, but we were rarely using it. Change-Id: I812b9e6c8fbf204aba43ce2b79eca308ca75de88 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* / Fix: "Missing emit keyword on signal call"Alessandro Portale2019-02-131-1/+1
|/ | | | | | | [-Wclazy-incorrect-emit] Change-Id: I32cf5db522dcb14bbe5151914624979929eeb52e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Add QTextOption/QTextEdit/QPlainTextEdit::tabStopDistance propertyEskil Abrahamsen Blomfeldt2017-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt, we have QTextOption::tabStop, QTextEdit::tabStopWidth and QPlainTextEdit::tabStopWidth. Neither are very good names, since the tab stop is neither a numerical value as in the former, nor does it have any dimensions that can be measured, as in the latter. Vertical text advances may also be supported by Qt at some point in the future, at which point the name would make even less sense. At the same time, we expose the actual type of the tab stop distance as floating point in the QTextEdit and QPlainTextEdit API instead of always rounding it to an int. To avoid duplicating either of these APIs in Qt Quick, we introduce tabStopDistance as the common term instead and deprecate the old names. [ChangeLog][Text] Introduced tabStopDistance property in QTextOption, QTextEdit and QPlainTextEdit as replacement for the inconsistently named tabStop and tabStopWidth properties. QTextOption::tabStop, QTextEdit::tabStopWidth and QPlainTextEdit::tabStopWidth have subsequently been deprecated. Change-Id: Ib7e01387910cddb58adaaaadcd56c0e69edc4bc2 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTextFormatCollection: replace copy ctor and op= with clear()David Faure2017-02-231-1/+1
| | | | | | | | | | | | | | | | | 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>
* Use QStringRef to optimize memory allocationAnton Kudryavtsev2016-08-181-5/+5
| | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef. Change-Id: I3c485f89352a1ee66076fba74fd486da9349c354 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-10/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * Gui: use const (and const APIs) moreAnton Kudryavtsev2016-06-011-10/+11
| | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I88d08d499e1be72c1f6d983fecdcee513df18aa2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Fix QTextEdit/QQuickTextEdit undo bug - Part #2Dan Cape2016-03-021-2/+3
|/ | | | | | | | | | | | | | | | | | | | | | If a user selected the text "foo" and typed "bar", upon pressing undo, the text would change to "b". This is incorrect and does not match the functionality of QLineEdit or the default behaviours of Windows/OSX/Ubuntu. This was fixed by a change made to always merge two sequential inserts if they are not part of the same block. Previously the selection delete and the "b" were part of one edit block and "ar" was part of another. With this change, the selection delete and "bar" are part of the same edit block. Unit test changes are part of a separate review (Part #1) since they required changes in qtdeclarative. [ChangeLog][QtGui][Important Behavior Changes] Fixed QTextEdit to match undo functionality of QLineEdit to group two sequential inserts into one undo action. Task-number: QTBUG-38825 Change-Id: I76bf30e331e3526277c3e0ade58cf95b611fc117 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QVector: preserve capacity in clear()Marc Mutz2016-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | This is what std::vector implementations usually do, because it minimizes memory fragmentation and useless allocations since no user will call clear() unless she intends to append new data afterwards. Fix calls to resize(0) that show how existing code tried to work around the issue. Adjust test. Port from QVERIFY(==) to QCOMPARE as a drive-by. [ChangeLog][QtCore][QVector] clear() now preserves capacity. To shed capacity, call squeeze() or swap with a default-constructed QVector object, see the documentation for an example. Change-Id: I9cebe611a97e027a89e821e64408a4741b31f1f6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Revert some changes to QTextCursor constructorshjk2016-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | This partially reverts the source and binary incompatible parts of change d921a9bd157b04242722ab4326c5f2ea8e88cbea that made public members in an exported class private and changed signature in one case. Task-number: QTBUG-50703 Change-Id: I2719f276256206347d3c27d80a16db34a4ea2888 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtGui: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I90fd517ad542ef92034403c15ebb8300a56ac693 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| * Hide better the private API QTextCursor constructorsThiago Macieira2016-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Both constructors were taking a pointer, so they participated in overload resolution along with QTextDocument and QTextFrame pointers. Instead, make them take references and move them to the private section of QTextCursor. That necessitated adding a method to QTextCursorPrivate to access that private constructor from non-friend classes. Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.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>
* 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>
* Make the empty Q_ASSERT still check its argument for validityThiago Macieira2014-11-011-2/+0
| | | | | | | | | | | | | | | | | | | | | With the side-effect that variables and functions in the argument are now "used". This means we don't need to #ifndef functions only used in assertions: the compiler will eliminate them by dead code elimination. Due to the mandatory short-circuiting of the condition, no functions will ever be called and this expands to no more code than before. On the negative side, because we won't get warnings for unused variables initialized outside the Q_ASSERT, non-inlineable calls will not be elminated by dead code elimination, so they will remain in release code without warnings. Because of the expanded code now in Q_ASSERT, the Intel compiler's optimizer gets thrown: it complains that the non-void function is failing to return anything, so I had to add two return statements. Change-Id: I1bb79c9637a2771ef1ec093f901b8d2443788bd6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* 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>
* src/gui/text: whitespace fixesJ-P Nurmi2013-11-261-38/+38
| | | | | Change-Id: Idd0e0673d76a23593b03558e18bc6afbdb9b38ab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Register QTextDocument* as a meta type to fix QTextEdit::document typeJ-P Nurmi2012-08-181-0/+2
| | | | | | Change-Id: I666845049749bfa6f88b764eefaefb0dcf05cb3f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Compile with clang when C++11 support is enabledBradley T. Hughes2012-05-301-1/+1
| | | | | | | | | | | text/qtextdocument_p.cpp:1070:43: error: non-constant-expression cannot be narrowed from type 'int' to 'quint32' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] text/qtextdocument_p.cpp:1070:43: note: override this message by inserting an explicit cast Change-Id: I16127aef2171324135b5c0c2ac611b8b4f03d7b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-211-2/+2
| | | | | | | | | as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Join user state of removed text blocksLeandro Melo2012-01-171-9/+10
| | | | | | | | | Note: Indentation of surrounding code was fixed. Done-with: mae (cherry picked from commit 8d3d3381c127f0f4dd9fc507c3069acddbf40535) Change-Id: I8d3d3381c127f0f4dd9fc507c3069acddbf40535 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>