Commit Graph

180 Commits

Author SHA1 Message Date
Liang Qi 1a4346d112 QQuickTextInput: added preeditText property
Task-number: QTBUG-49503
Change-Id: I803c9fc3bddba81d08e1dd450bc5a5f8a5605720
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-01-13 18:09:54 +00:00
Liang Qi 4ab7deb923 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Ica75a71062d0613e415f2433c5c22c2e251b37cd
2015-12-07 13:20:36 +01:00
J-P Nurmi df49f17ed6 QQuickTextInput: handle QKeySequence::DeleteCompleteLine
Change-Id: I56bb1f56a9c37137bab322b699d6345e82449c9c
Task-number: QTBUG-49643
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-11-26 17:27:35 +00:00
Liang Qi c08ec43406 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I3567f741394f912d4312460e85555b6c39b61cb4
2015-11-21 10:34:41 +01:00
Liang Qi 4fabebb332 Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	src/quick/util/qquickimageprovider.cpp

Change-Id: I7ca4e49468b5ba697208287be4684e42b9900023
2015-11-17 07:19:54 +01:00
Mitch Curtis 166ed1f21d Fix grammar in TextInput documentation
Change-Id: I78ecd97c25da70faf8438dd02d50952d2fb80a22
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-11-02 16:10:07 +00:00
Sérgio Martins 4867a49618 Use QStringRef in a bunch of places.
Done automatically with clazy static analyzer.

Change-Id: Ia0cf8fa24331ab102a3c3c30c2aa92ef1ba772e2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-10-18 23:12:14 +00:00
J-P Nurmi 1a335f6ae3 QQuickTextEdit/Input: revise implicit resizing - take two
Referencing unexported symbols (ExtraData) from an inlined method does
not work with MinGW.

Change-Id: I19935c84c4e2014f73bcd1801d182d193166bd44
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-10-04 08:14:49 +00:00
J-P Nurmi 0a5db49d0d QQuickTextEdit/Input: revise implicit resizing
Rename explicitImplicitSize to better descriptive implicitResize,
and add a method to disable the default behavior. QQuickTextField
was unable to access the flag directly, because ExtraData is not
exported (and we prefer to keep it that way).

Change-Id: Ia8b8281267adfc376e03a14882708e9cf80f0451
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-10-03 12:54:36 +00:00
Nico Vertriest 43941ec6c2 Doc: Corrected link errors
Change-Id: Ia3973c9d46a9fe8c511d24e20c9c23a1c7d4660d
Task-number: QTBUG-43810
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-09-07 13:46:55 +00:00
J-P Nurmi 42f58e5570 TextInput & TextEdit: allow controls to override the implicit size
Change-Id: I4b5eae46a9fef574249eee9061858bdf874c54be
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-09-06 00:09:38 +00:00
Ulf Hermann eb30e3d7ee Merge remote-tracking branch 'origin/5.5' into 5.6
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
2015-08-18 10:29:47 +02:00
Allan Sandfeld Jensen e01bea8999 Font matching by font stylename
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>
2015-08-10 08:55:06 +00:00
Nico Vertriest a169d310e4 Doc: replace Mac OS X with OS X
Task-number: QTBUG-40759
Change-Id: If21b4551eb95af3370cc21edd7a6721fc06e1346
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-07-15 13:57:21 +00:00
J-P Nurmi 15d6c938b2 Export QQuickTextInputPrivate and QQuickTextEditPrivate
...so that QtQuick.Controls 2 TextField and TextArea can inherit them.

Change-Id: I9383927c51a70848753a9f41f374d4161000fbb1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-23 20:33:30 +00:00
Ulf Hermann 9eb3015a62 Don't resolve the d-pointer when we don't use it.
Change-Id: Ia8551e28dcd237a536038ed7f658a3d1164706c6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-15 09:31:10 +00:00
Liang Qi 2cb853c429 QQuickTextInput: move paddings into extraData
Task-number: QTBUG-46529
Change-Id: Ifa072dccdf2dc8c52c6865d13ccf1930c92ec51d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-06-15 09:31:01 +00:00
Ulf Hermann 7e895fc466 Mark unused parameters as Q_UNUSED
Change-Id: I4f859916debfb39d822a9c2a9c8bdf675d70d702
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-14 18:08:56 +00:00
Marc Mutz 81117c771c Fix users of QTextLayout::additionalFormats to use the new API
QTextLayout::additionalFormats setters and getters using QList<FormatRange> have
been deprecated; port to the QVector versions.

Change-Id: I6702430c09b30aa033fe4e34f39a9aa3350e471b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-06-05 10:08:35 +00:00
Simon Hausmann 9556f6d075 Merge remote-tracking branch 'origin/5.5' into dev
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
2015-06-04 10:28:48 +02:00
Kai Uwe Broulik bc846fa530 Keep cursor visible during keyboard interaction
This makes it consistent with widgets cursor behavior.

Change-Id: I1be958e0c8afb7c7c8b5ebad5d06b06013e83699
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-21 18:15:52 +00:00
Santtu Lakkala 4e944555aa Hide cursor when text fields becomes read only
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>
2015-05-12 08:23:16 +00:00
Shawn Rutledge 0f61aa5efe Add QtQuick::Text::font.weight enum values
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>
2015-05-11 15:07:42 +00:00
Liang Qi 4b72f48637 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/quick/util/qquickpixmapcache.cpp
	tests/auto/quick/qquickwindow/BLACKLIST

Change-Id: Ie81612f2884f8ea508c48ba2735ec54ea1c2eca5
2015-04-13 09:46:15 +02:00
Kai Uwe Broulik cee040d75c Honor setFocusOnTouchRelease in QQuickTextInput
[ChangeLog][QtQuick][TextInput] SetFocusOnTouchRelease is honored

Change-Id: I0c5150465effadb7b1221250875aedf16a83bb2c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-30 13:05:14 +00:00
J-P Nurmi 3119e7edc2 Move QtQuick validators out of qquicktextinput_p.h
TextField (v2) inherits QQuickTextInput, and therefore has to include
qquicktextinput_p.h. Move the internal Q_AUTOTEST_EXPORT'd classes out
of the header to avoid build problems on Windows due to missing symbols

Change-Id: I6f37cf4e112425ff6c4c0a4ccc5e584f26599d8a
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-03-18 08:40:32 +00:00
Gabriel de Dietrich 85c4904ec8 Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev 2015-03-06 11:16:18 +00:00
J-P Nurmi b419ca92be TextInput: add support for padding
This makes it possible for TextField to inherit TextInput, reserve
space for the decoration, and set the desired property defaults
without having to create dozens of property aliases.

[ChangeLog][QtQuick][TextInput] Added padding, leftPadding, topPadding,
rightPadding and bottomPadding properties.

Task-number: QTBUG-41559
Change-Id: Iaa7697a10a6f66685c7cae454edf4c1984d411bc
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-03-05 22:45:13 +00:00
Friedemann Kleint adaa3fc546 Fix invocations of static methods of QGuiApplication/QCoreApplication.
Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-03-05 10:03:30 +00:00
Frederik Gladhorn ad67ec26d0 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	.qmake.conf
	LICENSE.GPLv2
	examples/qml/networkaccessmanagerfactory/view.qml
	src/qml/jsruntime/qv4runtime.cpp
	src/qml/jsruntime/qv4stringobject.cpp

Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
2015-02-24 17:36:04 +01:00
Jani Heikkinen c5796292ad Update copyright headers
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>
2015-02-12 10:28:11 +00:00
J-P Nurmi 9663b7b5c1 TextInput: update the baseline offset when vertical alignment changes
Change-Id: I2153e879c7ad8b770d5ca47dac68f994bb171b2d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-02-03 20:32:06 +00:00
Simon Hausmann ff466a1881 Merge remote-tracking branch 'origin/5.4' into dev
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
2014-12-09 15:09:26 +01:00
Eskil Abrahamsen Blomfeldt dd08a22a4e Invalidate font caches when switching between threads
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>
2014-11-13 19:58:28 +01:00
J-P Nurmi 492c611d2b QQuickTextInput: don't ifdef out properties
Take out the implementation body instead. These conditional properties
are causing trouble for controls (invalid alias location).

Change-Id: I055e149a4fe2d4d5d0c62d21e5f5368e9973c512
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-11-01 11:43:57 +01:00
Samuel Nevala fe91958969 Android: Keyboard doesn't hide from done button
QLineEdit closes input method on enter key press, TextInput
should also do the same. Commit and hide input method on enter
key. When Qt::ImhMultiLine input method hint set only commit.

Task-number: QTBUG-37850
Change-Id: I5a06e3eb777d7f794dd1493b307f0b05a2caf281
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-10-24 10:20:06 +02:00
Richard Moe Gustavsen dac6bad5ba QQuickTextInput: calculate height of cursor rect using QTextLine::height()
Calculating the height of the line using ascent + descent seems
inaccurate, since the result will not match what ends up being
drawn. QQuickTextEdit uses instead QTextLine::height() for the
same function, and this works correct.
Since there seems to be no reason to reinvent how to calculate the
height when the line already has a function for that, and since the
result also seems to be wrong, we change the implementation to
use QTextLine::height().

Change-Id: I9c9cd4360b6d4cfd3582756c4efdff9c02065789
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-10 15:42:52 +02:00
Richard Moe Gustavsen 5b162837d8 QQuickTextInput: keep floating point precition when calculating offset
Without this patch, positionToRectangle will return a slightly
different rectangle than what ends up being drawn.

Change-Id: Ib1a3936f0fab393d6016d85d63547ec7f3036b7a
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-04 09:47:55 +02:00
Simon Hausmann 39286a50c3 Fix cursor blinking for TextInput and TextEdit
Before commit fb339b21b8 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>
2014-08-26 12:59:23 +02:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- 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>
2014-08-25 11:28:46 +02:00
Lars Knoll fb339b21b8 Create rectangle nodes in the text editing through the context
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>
2014-08-13 15:03:51 +02:00
Topi Reinio bfce837c3d Doc: Remove duplicated words
Removes duplicated (repeated) words and fixes other minor
documentation issues.

Change-Id: I891f2b3e60194b207737425c1dcc1d35a5bd921a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-08-12 10:47:35 +02:00
J-P Nurmi 29e2497a2c TextInput::displayText: include partial input from an input method
[ChangeLog][QtQuick][Important Behavior Changes] TextInput::displayText
now includes also partial input from an input method and thus matches with
the actual displayed text.

Task-number: QTBUG-40329
Change-Id: I407f464938c550d73eba1351283ec751aa293380
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-08 00:25:55 +02:00
Aaron McCarthy b25035e512 Fix incorrect acceptableInput value on construction.
The value for acceptableInput was being calculated every time the
property value was read. This can lead to situations where the value
returned from successive property reads is different even though no
acceptableInputChanged() signal is emitted between the two calls.

This can be seen during QML component construction where emission of
the changed signal is suppressed until the component completes and the
value of acceptableInput changes as the other properties are set. If
the property is read during binding evaluation an intermediate value
can be seen and the QML engine will not re-read the property until
after the changed signal is emitted. This doesn't happen until the true
value of the acceptableInput property is toggled.

Fixed by changing the property getter to returned the precalculated
value of acceptableInput and ensuring that this value is set when
correctly.

Change-Id: Id3ba3a34988ff50f590e4f8330b873f390eaa025
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
2014-07-24 06:33:59 +02:00
Frederik Gladhorn 427bee6cb6 Merge remote-tracking branch 'origin/5.3' into dev
Change-Id: Iba61035910c46627e5e1c3824757da7b3d573657
2014-07-10 10:12:13 +02:00
Nico Vertriest 2dcad8f5c8 Doc: correct link/compilation errors in Qt Declarative
Task-number: QTBUG-34749
Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-07-02 14:52:54 +02:00
J-P Nurmi 6725bc8f16 TextInput: implement the new input method API
Change-Id: I8a2f66a6cfa346627394705741d2f47affcd0c2b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-06-02 22:19:17 +02:00
J-P Nurmi dc5f86c8ff Introduce TextInput::ensureVisible(int position)
This is required for TextField to be able to implement text selection
handles. TextField needs to be able to ensure that the appropriate
character position becomes visible when the handles are moved around.

[ChangeLog][QtQuick][TextInput] Added TextInput::ensureVisible(int pos)
method to be able to control the scrolling position of a TextInput that
has automatic scrolling enabled.

Task-number: QTBUG-38934
Change-Id: Id77eafcda6324d10868e0798519e5b712a0d33ed
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-05-21 13:11:18 +02:00
Frederik Gladhorn 66646dd8c3 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	.qmake.conf
	src/plugins/accessible/quick/quick.pro
	src/quick/items/qquickpincharea.cpp
	src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
	src/quick/scenegraph/qsgthreadedrenderloop.cpp

Manually adjusted for TestHTTPServer constructor change:
    tests/auto/quick/qquickimage/tst_qquickimage.cpp

Change-Id: I5e58a7c08ea92d6fc5e3bce98571c54f7b2ce08f
2014-05-10 11:53:47 +02:00
Bernd Weimer c2d802049e Always implement text input "canPaste" property
This is needed for TextField control for instance.
If QT_NO_CLIPBOARD is defined, canPaste will always return false.
Fixes dialogs auto test when QT_NO_CLIPBOARD is defined.

[ChangeLog][QtQuick][Platform Specific Changes] Added canPaste
property to TextInput element also on platforms that don't support
a clipboard (QT_NO_CLIPBOARD is defined).

Change-Id: Ia85205672ba59c1fce70852458c514b03d332de6
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-04-24 10:15:51 +02:00