aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Doc: Corrected link errorsNico Vertriest2015-09-071-1/+1
| | | | | | Change-Id: Ia3973c9d46a9fe8c511d24e20c9c23a1c7d4660d Task-number: QTBUG-43810 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* TextInput & TextEdit: allow controls to override the implicit sizeJ-P Nurmi2015-09-061-6/+10
| | | | | | Change-Id: I4b5eae46a9fef574249eee9061858bdf874c54be Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-7/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * Fix selections in tables that span over several cellsEskil Abrahamsen Blomfeldt2015-08-041-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the code that converts text layouts to subtrees in the scene graph specifically for TextEdit, there was a cutoff to treat text tables as single nodes in the graph (for simplicity). However, this breaks selections, since the ranges spanned by each cell will be interpreted as overlapping, messing up the selection merging logic. We need the same approach here as for any other text frame where we check frame boundaries. [ChangeLog][TextEdit] Fixed issues with selections that spanned several cells in a table. Change-Id: I789041d84b5d163e209488f8f2f1f83a6471389f Task-number: QTBUG-46928 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* | Font matching by font stylenameAllan Sandfeld Jensen2015-08-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | Some fonts may have styles that does not directly match to QFont properties. To support those QFontDatabase supports matching by style name. This patch exposes that to QML. Change-Id: I9896f2e3d9f6b56fb51f5694b018b456bcd05ed6 Task-number: QTBUG-30851 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Export QQuickTextInputPrivate and QQuickTextEditPrivateJ-P Nurmi2015-06-231-0/+7
| | | | | | | | | | | | | | ...so that QtQuick.Controls 2 TextField and TextArea can inherit them. Change-Id: I9383927c51a70848753a9f41f374d4161000fbb1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | QQuickTextEdit: move paddings into extraDataLiang Qi2015-06-151-42/+56
| | | | | | | | | | | | Task-number: QTBUG-46529 Change-Id: I67b8125d160213121b30fbb44fa834609d668099 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Mark unused parameters as Q_UNUSEDUlf Hermann2015-06-141-0/+2
| | | | | | | | | | Change-Id: I4f859916debfb39d822a9c2a9c8bdf675d70d702 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QQuickText: Don't store node engine per node.Robin Burchell2015-06-061-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since these are only used during one particular phase of dealing with text, it is extremely wasteful to heap allocate them and keep them around for the entire lifetime of the node (~3kb of total allocation _each_ according to OS X). Removing these cuts around 100mb of transient allocations off the qmlbench text creation benchmark (and takes the total allocations during a test run from ~496 MB to ~389 MB). It also improves the approximate throughput for creation of text items by ~5%. Change-Id: I45c8a50879ed545da1fb13ab3c2c5d857b112cf7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-041-3/+13
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/quick/items/qquickitemsmodule.cpp src/quick/items/qquicktext.cpp src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
| * Hide cursor when text fields becomes read onlySanttu Lakkala2015-05-121-3/+9
| | | | | | | | | | | | | | | | | | | | Clear the cursor node in TextEdit if field is read only. Otherwise the cursor stays visible indefinitely, if it were at the moment the flag was set. Task-number: QTBUG-44735 Change-Id: Ib39138260ad8a4d7e5ed2185b8a04c577ee1eff0 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * Add QtQuick::Text::font.weight enum valuesShawn Rutledge2015-05-111-0/+4
| | | | | | | | | | | | | | | | | | | | Followup to 517da68893be9e6d97c7993922c573de9560604d in qtbase: make all possible font weights available in QML. Task-number: QTBUG-38482 Change-Id: I4f821d2fadbcd42fbb237903be474d67a0a5a7c9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Fix build with QT_STRICT_ITERATORSSérgio Martins2015-05-151-1/+1
| | | | | | | | | | Change-Id: I3df6ac107cb46b3a1b15b80f39d7c6015adcd9ac Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-131-4/+7
|\| | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/BLACKLIST Change-Id: Ie81612f2884f8ea508c48ba2735ec54ea1c2eca5
| * Fix TextEdit when vertical alignment != AlignTopEskil Abrahamsen Blomfeldt2015-04-091-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the TextEdit's alignment was either AlignBottom or AlignVCenter, several things would be broken: First of all the position of all non-dirty nodes would not be updated, so if you e.g. added text to the end of the document, it would overlap with the previously added text. Also, the frame decorations were always aligned to the top, since the basePosition was not accounted for in the node for this. The fix is to translate the root node to the base position instead of baking this into the position of the text nodes. This also automatically fixes frame decorations since it's already aligned to the top of the root node. [ChangeLog][TextEdit] Fixed issues with using other vertical alignments than AlignTop. Change-Id: I11f73eab21a28658a5cbf00292fd519efd0f3e7f Task-number: QTBUG-45032 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devGabriel de Dietrich2015-03-061-2/+9
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into devGabriel de Dietrich2015-03-061-2/+9
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquicktextedit.cpp Change-Id: I354093ceb996aae40254f2143dec2bb74cf5eb17
| | * TextEdit: Block's update should update paint nodeRuslan Nigmatullin2015-03-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickTextEdit::invalidateBlock method marks nodes as dirty but doesn't call QQuickItem::update(). Because of that it's impossible to rehighlight text by QSyntaxHighlighter. Task-number: QTBUG-44765 Change-Id: Ibfd973430cf00927dbec027d129c6d722634575e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| | * Fix invocations of static methods of QGuiApplication/QCoreApplication.Friedemann Kleint2015-03-051-2/+2
| | | | | | | | | | | | | | | Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | | TextEdit: add support for paddingJ-P Nurmi2015-03-051-8/+188
|/ / | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible for TextArea to inherit TextEdit, reserve space for the decoration, and set the desired property defaults without having to create dozens of property aliases. [ChangeLog][QtQuick][TextEdit] Added padding, leftPadding, topPadding, rightPadding and bottomPadding properties. Task-number: QTBUG-41559 Change-Id: I4fa22f86e6151524a63b2b862f17bc9d6a713142 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* / TextEdit: add editingFinished signalLiang Qi2015-03-031-0/+12
|/ | | | | | | | | | | Autotest is included. [ChangeLog][TextEdit] add editingFinished signal Task-number: QTBUG-44734 Change-Id: Ib632e589419758bea09442e6efcf4d977b9a13e8 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-191-3/+3
| | | | | | | | Use std::math on floats and doubles, and qMath on qreals, and only include the math headers actually needed. Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update copyright headersJani Heikkinen2015-02-121-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. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2015-01-161-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4debugging.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4functionobject_p.h src/qml/jsruntime/qv4qobjectwrapper.cpp src/quick/scenegraph/shaders/visualization.frag tests/auto/qml/qjsengine/tst_qjsengine.cpp Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30
| * Fix grammatical error in Text and TextEdit documentation.Mitch Curtis2015-01-091-1/+1
| | | | | | | | | | Change-Id: I6fd68166108a060931cd6bcd64ccd865d251a4c3 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
| * TextEdit: fix construction time text cacheJ-P Nurmi2015-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | QQuickTextEdit does not apply cached text to the underlying document until component construction is complete. However, if text() was called during the construction (eg. because of a binding), it would blindly overwrite the cached text with (still) empty document content. Task-number: QTBUG-41583 Change-Id: I6c5c1b6283d70d8a5ec2c8bd986095ee3c35a14c Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-0/+31
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Invalidate font caches when switching between threadsv5.4.0-rc1Eskil Abrahamsen Blomfeldt2014-11-131-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The font caches can only be used from a single thread at a time. QFontEngineFT for instance, uses a global static thread storage which is accessed on releasing and creating engines, and this causes a crash if the font engine is created on one thread and released on another. We use the updatePolish() function to make sure the caches are empty before entering updatePaintNode(), and then we invalidate the cache again after updatePaintNode() is done. [ChangeLog][Text] Fixed uncommon crash in text nodes. Change-Id: I01dbc2ed58aeebd03d77a157c700330334bdb385 Task-number: QTBUG-38800 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QQuickTextEdit: don't ifdef out propertiesJ-P Nurmi2014-11-011-4/+12
|/ | | | | | | | Take out the implementation body instead. These conditional properties are causing trouble for controls (invalid alias location). Change-Id: I509c6a156b8f6c6fa12488bfc5e301f60346f8a5 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Fix cursor blinking for TextInput and TextEditSimon Hausmann2014-08-261-6/+8
| | | | | | | | | | | | | | | Before commit fb339b21b8a24b835cea7a057c47b7c5ad80dd72 relied on the simple transparent rectangle node to remain invisible. After that commit we used the regular rectangle node, which doesn't seem to like toggling the color between transparent and solid black and therefore the cursor was always visible. As advised by Gunnar this patch implements a much simpler logic: When the cursor is supposed to be invisible, we just don't create a scene graph node for it anymore. Change-Id: I7b0e173f6d37997559ee0911f37903efdb14847f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Create rectangle nodes in the text editing through the contextLars Knoll2014-08-131-3/+3
| | | | | | | | | | Unfortunately we can't re-use the QSGSimpleRectNode, as it doesn't provide us with virtual methods to move it's creation into the context. But's since it's only 20 lines of code anyway, this is still a nice cleanup. And it also allows the re-use of any optimizations in the renderer for QSGRectangleNode. Change-Id: I957777fbbeb0a994a9c257baf3bfe87fce8cc9e8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix Node object leak in QQuickTextEditPrivateLiang Jian2014-07-231-1/+5
| | | | | | | Delete Node objects stored in textNodeMap at two places to prevent leak. Change-Id: I8eb0d1af900c94e1fab2f55b689de393e674f0aa Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Doc: correct link/compilation errors in Qt DeclarativeNico Vertriest2014-07-021-1/+1
| | | | | | | Task-number: QTBUG-34749 Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Android: Add support for new input method query APIPaul Olav Tvete2014-05-081-3/+11
| | | | | | | | | Change 93fd268d implemented the new API, but missed the final piece that actually made use of it. Task-number: QTBUG-38824 Change-Id: Iea28f2cbb8c6d749d781dcf7437552597977f9ac Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Invalidate text painting nodes when document text block is updatedSarunas Valaskevicius2014-05-051-0/+6
| | | | | | | | | | | | | The commit fixes text repainting when only formatting of the text is changed by invalidating the affected blocks which will be repainted on the next update. Task-number: QTBUG-36743 Change-Id: I03ba747f9d08a9f49d0a012b8349c89c20dc6b55 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Doc: Fix broken \qmlsignal linksSze Howe Koh2014-03-181-1/+1
| | | | | | | | Fix the breaks caused by the re-categorizing of \qmlsignal pages Task-number: QTBUG-35846 Change-Id: I528ae16ec522fc902133e22d8f53c87a7f0d56ad Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-4/+8
| | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Ensure TextEdit's text is vertically aligned after resizing its height.Mitch Curtis2014-03-131-1/+2
| | | | | | | | | | | | | The current code only updates the alignment if the width of the TextEdit changed, but we must also check if the height has changed. Task-number: QTBUG-36069 [ChangeLog][QtQuick][TextEdit] Fixed TextEdit not vertically aligning its text after having its height changed. Change-Id: I0b2d6a7384457ca1018fc9899c82699e8ecfcbd4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix TextEdit::lineCount to update as appropriateJ-P Nurmi2014-03-101-1/+1
| | | | | | | | | | The total line count needs to be updated when geometry, document size or wrapping mode changes. Task-number: QTBUG-37263 Change-Id: If58a2f77022475e8bcb7cca0f2a091ee837b39a5 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Expose TextEdit::linkAt(x, y)J-P Nurmi2014-01-291-2/+17
| | | | | | | | | | [ChangeLog][QtQuick] Added TextEdit::linkAt(x,y) method. Task-number: QTBUG-18946 Change-Id: Id9d061e6c9d857c2f0283ad5042097828d1ed02d Reviewed-by: Martin Jones <martin.jones@jollamobile.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Allow renderType: Text.NativeRendering on retina displays/devicesTor Arne Vestbø2014-01-271-4/+1
| | | | | | | | | | | | | Setting the renderType to Text.NativeRendering might be needed in some cases where distance-field does not produce the expected results, such as for emoji characters or really large fonts. These use cases are valid on retina displays as well, so having the setter second-guess the request from the user to use native rendering is not ideal. Change-Id: I7c6049766e60574487c29de07fbd5c100ec69a2a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QQuickTextDocumentWithImageResources: use QTextDocument::baseUrlJ-P Nurmi2013-12-041-2/+2
| | | | | | | | | QTextDocument::baseUrl was introduced in qtbase commit 1f22c1d. The ultimate goal is to get rid of QQuickTextDocumentWithImageResources and eventually make QQuickTextEdit's document interchangeable. Change-Id: Ibafeecc395b52f7200d8164f809bf76538e5620c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-1/+1
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Clear text node references after sub-tree has been cleaned up.Alan Alpert2013-10-241-0/+3
| | | | | | Task-number: QTBUG-34181 Change-Id: I861e192cee2c683efee79e7404a5c9d70b60691f Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-67/+67
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Avoid out-of-bounds read.Gunnar Sletta2013-09-251-1/+1
| | | | | Change-Id: I28777806b13da1b0a9e1fecc2734de0614f2443c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Made Qt Quick items' \since consistent.Jerome Pasion2013-09-251-5/+5
| | | | | | | | | | | | | | | | Qt 5.2: -"\since QtQuick 2.2" -> "\since 5.2" Qt 5.1: -"\since QtQuick 2.1" -> "\since 5.1" -"\since Qt 5.1" -> "\since 5.1" Qt 5.0: -"\since QtQuick 2.0" -> "\since 5.0" Task-number: QTBUG-32172 Change-Id: I699b00b31373a434ddb8f4caccfef40c588bf8a4 Reviewed-by: Martin Smith <martin.smith@digia.com>