summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qplaintextedit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Widgets: replace deprecated QPalette functionsChristian Ehrlicher2018-12-171-1/+1
| | | | | | | | QPalette::foreground()/background() are deprecated since 5.13 - replace those functions with their successors. Change-Id: I80e49dadd7be1007d73ac920f6db2b8e608db06a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-251-2/+7
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Fix scrollbar updates in QPlaintTextEdit on block-visibility changesAllan Sandfeld Jensen2018-10-171-2/+7
| | | | | | | | | | | | | | | | | | Trigger documentSizeChanged when block visibility changes, since block count remains constant in this case. Task-number: QTBUG-69310 Change-Id: I5ec7a4f9008f26ea8602356bcbaefbda293e54a3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Implement QRegularExpression overload for QPlainTextEdit::findSamuel Gaist2018-10-081-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds the missing overload for QRegularExpression to match the QRegExp one for QPlainTextEdit. [ChangeLog][QtWidgets][QPlainTextEdit] Added QRegularExpression find() method overload. Change-Id: Id156971d3fa0372712bfa8b72a55550942a767e0 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-081-6/+0
|\| | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
| * Make overloaded function appear in assistant indexJarek Kobus2018-10-011-6/+0
| | | | | | | | | | | | | | | | | | | | When there are overloaded function for one class, at least one of them mustn't possess \overload command, otherwise it won't appear at all in doc index. Task-number: QTBUG-59506 Change-Id: I650a3969cb45c1a5efdfc3a654e01d113c398f16 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-291-1/+1
|\| | | | | | | Change-Id: I6083c3e61b7dbe188f83676f7e7bb268e5ccf2f3
| * Fix disabled IME when QPlainTextEdit read only property is toggledJussi Witick2018-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | Mirror the behavior of working QTextEdit in QPlainTextEdit. The WA_InputMethodEnabled flag was overridden by the following call to setTextInteractionFlags(). Task-number: QTBUG-55699 Change-Id: I46402f5d94204acd304d56f488bb0fb342d1a846 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QPlainTextEdit: add current state of modifiers to auto scroll eventDavid Schulz2018-09-271-1/+1
| | | | | | | | | | | | Fixes: QTBUG-64856 Change-Id: I8de851e75204bbeb7f3fbd40a5f2200028cc9337 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QPlainTextEdit: update scrollbars after setting center on scrollDavid Schulz2018-09-261-0/+1
|/ | | | | | Fixes: QTBUG-64730 Change-Id: I6ff7b10eb209a407c99529a09226cd97f9b6e9f8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * Doc: Add missing full stops in briefsPaul Wicking2018-06-211-1/+1
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-071-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-291-2/+4
| | | | | | | | | | | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Handle negative leading in layoutAllan Sandfeld Jensen2018-06-061-0/+3
| | | | | | | | | | | | | | | | Adjust line positions to deal with negative leading which isn't included in height of QTextLine. Change-Id: Id7918968c0f9d7e65700b9e7a08fc5d761883f22 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Port placeholder rendering to palette placeholder color roleFilipe Azevedo2018-05-041-2/+1
|/ | | | | Change-Id: I7671d4b55677866b61627cc55a3029a3848f455d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Update usage of QFontMetrics::width() to new APIEskil Abrahamsen Blomfeldt2017-12-081-1/+1
| | | | | | | | | | | | | | QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPlainTextEdit: draw placeholder text correctly when it wrapsRichard Moe Gustavsen2017-10-121-11/+32
| | | | | | | | | | | | | | | | | 382faed introduced placeholder text to QPlainTextEdit. But the code relied on the text begin short enough to fit inside the width of the text edit. If the text was longer, and therefore wrapped, drawing artifacts would show. This patch will listen for text changes and check if the placeholder text should show or not, and if so, issue a full update to ensure that the whole placeholder text is either fully drawn or hidden. And then we allow to the placeholder text to be drawn inside the full rect of the text edit. Task-number: QTBUG-61875 Change-Id: I808472839ab397340080b56407c76e74f9ad1ae6 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-4/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| * Convert features.menu to QT_[REQUIRE_]CONFIGStephan Binner2017-09-191-0/+2
| | | | | | | | | | Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Convert features.textedit to QT_[REQUIRE_]CONFIGStephan Binner2017-09-191-4/+0
| | | | | | | | | | Change-Id: I0fb0e658796484f374586d8d1f0f1b9167ab30d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenu.h src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/styles/qstylehelper_p.h Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
| * Convert features.scrollbar to QT_[REQUIRE_]CONFIGStephan Binner2017-08-101-1/+1
| | | | | | | | | | Change-Id: Id6ea899c0fddf0de636701cfdc5f01ba20024976 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Add QTextOption/QTextEdit/QPlainTextEdit::tabStopDistance propertyEskil Abrahamsen Blomfeldt2017-08-061-4/+26
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Convert features.wheelevent to QT_CONFIGStephan Binner2017-06-281-1/+1
| | | | | Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QPlainTextEdit: not show place holder when having preedit stringLiang Qi2017-06-081-1/+1
| | | | | | | Task-number: QTBUG-61210 Change-Id: I4891c21fc4e1923b5929defeacab26114c00a7e3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Change confusing Q_DEAD_CODE_FROM_QT4_FOO defineTor Arne Vestbø2016-10-141-1/+1
| | | | | | | | | | | | | | | | | | | Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code that the code in question was a left-over from Qt4, when we used Q_WS_ defines instead of Q_OS_ defines. This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually unconditionally included. To make this even clearer, the defines have been replaced by checks for 1 or 0, with a comment describing how the code used to look in Qt4. The use of constants in the check also makes it easier for editors to parse the condition and show visually that the code is defined out. Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add Qt::ImInputItemClipRectangle support to widgetsJan Arve Saether2016-05-021-1/+6
| | | | | | | | Let widgets respond to ImInputItemClipRectangle inputMethodQuery and notify about potential changes with QInputMethod::update() Change-Id: I01b2c53273df207d26107b237a7096fe53d1b0a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-291-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| * Change scroll and text areas to respect native wheel focus ruleMarko Kangas2016-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWidgets][QAbstractScrollArea,QTextEdit,QPlainTextEdit] Changed focus to Qt::StrongFocus. That respects platforms' native guidelines. Task-number: QTBUG-52559 Change-Id: I2aa25d25bbc15facce85ceb7d4a4c1d0ac7df962 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QTextEdit: update cursor and anchor rect upon scrollingRichard Moe Gustavsen2016-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | Both cursor and anchor rect will change locally when scrolling. So inform IM about it, so that any overlay done from e.g the platform plugins for dealing with text selection etc. can respond to the change. Change-Id: I4e839e691a20ad07d2aa062e028d22cf5f31b7fa Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | QTextEdit: translate IM argument before passing it on to QWidgetTextControlRichard Moe Gustavsen2016-04-131-1/+19
| | | | | | | | | | | | | | | | | | | | Since we now have the possibility of providing an extra position argument when querying for Qt::ImCursorPosition, we need to ensure that we translate it from scroll view to local coordinates before passing it on to QWidgetTextControl. Change-Id: I4383ae3ea984b6140d8e9b4198047aec8b7e100b Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-041-17/+15
|\| | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * Refactor methods QTextEdit/QPlainTextEdit::inputMethodQuery().Friedemann Kleint2016-03-301-17/+15
| | | | | | | | | | | | | | | | Replace if / else if chain by switch() and return the value instead of reassigning it. Change-Id: Ib87c54bbf9911a58d3ae764b71f19f33d59590ce Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QPlainTextEdit: Take vertical offset into account when answering input ↵Friedemann Kleint2016-03-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | method queries. Determine offset point to similar to QTextEdit::inputMethodQuery() and add an autotest. Task-number: QTBUG-51923 Change-Id: I8232eb348063e2cd95d0632fe74a6eb30c897eda Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
* | widgets: Pass non-trivially-copyable or large types by const-refSérgio Martins2015-12-121-1/+1
| | | | | | | | | | Change-Id: I912c6a9ee7b27350ac3d1fe147b697338e76f53c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtWidgets: use Q_UNLIKELY for every qWarning() (1)Marc Mutz2015-11-211-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qWarning(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. This change contains the changes to the util/, dialogs/ and widgets/ subdirs. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In QSystemTrayIcon::setVisible(), as a drive-by, I swapped the evaluation order of an &&-expression (newly wrapped in Q_UNLIKELY) to be more readable and more efficient (cheaper check first) at the same time. Change-Id: I3564c5a5deacba49d67d3989fb0b53e680c57fcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix some qdoc-warnings.Friedemann Kleint2015-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add missing QPlainTextEdit::createStandardContextMenu(QPoint)J-P Nurmi2015-02-151-1/+20
| | | | | | | | | [ChangeLog][QtWidgets] Added QPlainTextEdit::createStandardContextMenu(QPoint) overload that takes the position in document coordinates. This method enables the actions that are sensitive to the given position eg. where the user clicked. Change-Id: I47ed7a1afc4fcfb3318c9b7af37867aeb7f2aa35 Reviewed-by: Marc Mutz <marc.mutz@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>
* Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-1/+1
| | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QPlainTextEditControl: reimplement anchorAt()J-P Nurmi2015-01-241-0/+4
| | | | | | | | | | | See comments in QPlainTextDocumentLayout::hitTest(). Since QPlainTextEdit does not do hit testing on the document layout level, allow QPlainTextEditControl to override anchorAt() so that hit testing can be done on the widget level instead. Change-Id: I70247eafae96897382a0c7db7d596128a03e7a6c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Fix a crash in QPlainTextEdit::documentChangedPierre Rossi2015-01-191-2/+1
| | | | | | | | | | | The layout for an invalid block is very likely to be null, it shouldn't be accessed without checking the block's validity first. We can make the check a bit more conservative and simply check that the block isn't empty. Change-Id: Ic1459a6168b1b8ce36e9c6d019dc28653676efbe Task-number: QTBUG-43562 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Text editors: Prevent autoscroll timer triggering from synth mouse eventsFriedemann Kleint2014-11-201-6/+8
| | | | | | | | | | The autoscrolling interferes with scrolling pan gestures and causes the scroll direction to be reversed when moving outside the window. Task-number: QTBUG-40461 Change-Id: I30ef848a346418929540c23730ab92f44e4565e2 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-061-1/+1
|\ | | | | | | Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
| * QPlainTextEdit: Fix crash on complex undo w/full width selectionEskil Abrahamsen Blomfeldt2014-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Say you have a document of two blocks of text. When you select a block of text in the document and then replace this with a new empty block (by pressing enter) and then subsequently undo this action, the following three steps are performed as a chain of undo commands: 1. Remove the empty block at the beginning of the document 2. Insert a new empty block at the beginning of the document 3. Insert the text back into the first block Since a block is removed and inserted in the same go, both blocks require a relayout, since the accumulated change spans both blocks. However, in QPlainTextDocumentLayout we would only look at the max of either removed chars or added chars. This would match the text length of the first block at this point, so we would only relayout that block. However, since we are also removing characters, the actual accumulated change to the document is larger. We should relayout any block touched by the sum of the added and removed character counts. Missing this, the paint event would later query block.layout()->lineForTextPosition(0) which would give an invalid line despite the fact that the block.length() > 0. This caused a crash in the paint event when the full width selection was turned on. Note that the logic here was only recently updated to include the removed characters at all in the logic, by the SHA1: 2983cb9531d47e5826540ca79e3066a8ed0db30c. [ChangeLog][QPlainTextEdit] Fixed a crash when using full width selections and issuing a complex undo command chain which removes and inserts an empty block in one go. Task-number: QTBUG-36415 Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51 Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@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>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Frederik Gladhorn2014-09-241-1/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8