Commit Graph

90 Commits

Author SHA1 Message Date
Friedemann Kleint 0959281be2 Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
Preparing the replacement of Q[TRY]_VERIFY(a == b) by
Q[TRY]_COMPARE(a, b) for non-boolean types.

Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 12:32:49 +00:00
Simon Hausmann 94db5de2ac Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	tests/auto/quick/qquicktext/tst_qquicktext.cpp

Change-Id: I075e742da8396a268d97d3ab34bcd9e0c0cf001f
2015-04-28 14:29:59 +02:00
Simon Hausmann e2447f9f5f Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	.qmake.conf
	tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp

Change-Id: I715b8a78b74cbe0dcaf599367fd6e08af4858e11
2015-04-27 14:40:00 +02:00
Simon Hausmann 79d56651ed Prospective fix for flakey "network" related QML tests
Replace hard-coded server ports with dynamically allocated ports.

Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-04-25 12:02:55 +00:00
J-P Nurmi e157fcba9e TextEdit: add support for padding
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>
2015-03-05 22:45:19 +00:00
Liang Qi cd3b88c594 TextEdit: add editingFinished signal
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>
2015-03-03 16:30:44 +00: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 5fa4e1d098 TextEdit: fix construction time text cache
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>
2015-01-08 18:18:15 +01:00
Richard Moe Gustavsen 02de9d7b6c text input: always let cursor rect have a width == 1
Instead of using a cursor width of null when a cursor
delegate is set, we should to use a value of 1.
Otherwise the rect we e.g return from cursorRect() will
be invalid. An alternative would be to use the width of
the delegate, but that was found to be controversial.

On iOS we saw a bug with this when telling iOS to position
text spelling popups underneath the cursor. Since the
cursor rect we got was invalid (zero-width), no popup
would show.

Change-Id: Ice51b9a1bd33f331183e3acec61b7d9c0f5163cd
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2014-10-30 10:32:53 +01: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
Frederik Gladhorn 809b5e2fc1 Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: I2e06c2fcd8aa9d5d090f0568be75272ec82f7b20
2014-08-14 11:35:30 +02:00
Gunnar Sletta 509125dbf4 Silence harmless compiler warning.
AlignJustify is not a tested value, but the compiler warning
can throw you off, so best to keep it quiet.

Change-Id: I0b3d717dfe2c11fc4367e7eceb5b83009c4e0a30
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-12 12:24:52 +02:00
Simon Hausmann 800025fb70 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I0dd91626837276f5811e4830f4a4e9f89bf1e1bd
2014-05-22 07:48:54 +02:00
J-P Nurmi 7667904801 Fix tst_qquicktextedit::cursorRectangle_QTBUG_38947()
Fix the uninitialize variable and make sure the test creates
a window that has a sensible (200x200) size.

Change-Id: I02616ab3c832276921e84ae98b7ed926d8fc5f5e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-05-19 14:49:58 +02:00
J-P Nurmi 8f6254a88e TextEdit: fix cursor rectangle positioning
QQuickTextControl::cursorRectangleChanged() wasn't emitted as
appropriate when dragging mouse => The cursor delegate was stuck
in wrong position under certain circumstances, especially when
selecting multiple lines.

Task-number: QTBUG-38947
Change-Id: Ib5b0d2f6ea2a1b3712fbaba4a7ad1865d2b0a74e
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-05-16 14:40:21 +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
Shawn Rutledge e60d8a2803 If a popup window is opened, do not change the focus
It's not working to have QQuickWindow lose focus every time a menu is opened.
This doesn't happen on OSX because menus are implemented as special native
ones, but on X11 a menu is another window.  In QtQuick Controls it's
useful for copy/cut/paste Actions to be enabled based on whether
some text has focus.

Change-Id: I092b46133b9a8a44639ad9d89ee2bdfe30206bd9
Task-number: QTBUG-36292
Task-number: QTBUG-36332
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-04-22 10:56:19 +02:00
Robin Burchell aa578c4e29 TestHTTPServer: Make listening an explicit operation that reports failure.
Use this to print the error message when listening fails, and switch to always
stack allocating TestHTTPServer instances for easier cleanup.

Change-Id: I63b2bd38963b66611dc08a5c322615d91a91e675
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
2014-03-21 00:09:29 +01:00
Mitch Curtis 2cd0b96a26 Ensure TextEdit's text is vertically aligned after resizing its height.
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>
2014-03-13 15:26:20 +01:00
J-P Nurmi afc10fe7bb Fix TextEdit::lineCount to update as appropriate
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>
2014-03-10 15:11:51 +01:00
J-P Nurmi 977a335ccd Expose TextEdit::linkAt(x, y)
[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>
2014-01-29 01:20:53 +01:00
Kai Koehne 3db49f7b9f Fix autotests expecting a trailing whitespace for qDebug stream
The behavior of QDebug was fixed in qtbase. Update autotests
accordingly.

Change-Id: I36c442fb772ba35b71b6ab50b5f77a3f9c1463e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-12-12 10:52:27 +01:00
Sergio Ahumada f1b9ba8c6e Merge "Merge branch 'stable' into dev" into refs/staging/dev 2013-08-06 18:26:47 +02:00
Sergio Ahumada 1d3b9db5b5 Merge branch 'stable' into dev
Conflicts:
	.qmake.conf

Change-Id: I06f79bcbde13c7b12905492a17dbcbb4a594e557
2013-08-05 10:42:21 +02:00
Rafael Roquetto b2a1db155b Fix tst_qquicktextedit
- Use showNormal() instead of show() to keep expected window sizes on
  fullscreen platforms.
- Use consistent point size for hAlignVisual
- Do not query for QQmlComponent::Loading on remoteCursorDelegate: when a new
  connection is established to the test http server, it will setup a single
  shot QTimer with a 500ms timeout that will trigger the reply to be sent
  back, making the call to sendDelayedItem() obsolete and reduntant. Also, it
  means that in some platforms, data will arrive back to the component before
  the check for QQmlComponent::Loading is executed, causing the test to fail
  since at this point the status will already be QQmlComponent::Ready instead.

Change-Id: I6508c28fa55a1aa2ae5861922701a8c322342380
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-02 15:02:47 +02:00
Simon Hausmann 993bc84f49 Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into merge
Change-Id: I5824a3eb624b325de10acfd5109c4c1bdabcf780
2013-07-26 11:52:32 +02:00
Friedemann Kleint 1099b26535 Stabilize text tests that grab windows.
Add window flags to make sure window stays on top to
tst_qquicktext::hAlignImplicitWidth() and
tst_qquicktextedit::hAlignVisual(). Add diagnostic output.
Determine the section size by checking the font size.
Add more characters to line 2 to make it more discriminative.

Task-number: QTBUG-32540
Change-Id: I19a74a775bf2663027ec211784870fd9f6547b48
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-07-25 20:45:19 +02:00
Frederik Gladhorn c3c943545e Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2279f181b1c30e81651f8907447ec5c826e11475
2013-07-23 11:10:39 +02:00
Friedemann Kleint b27461dcdf Replace qt.nokia.com by www.qt-project.org in tests.
Task-number: QTBUG-32390

Change-Id: If318cf9bbcaa36e6e60d693dd0cb9a58768af47b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-07-15 15:40:43 +02:00
Simon Hausmann 1a97598556 Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts:
	src/imports/qtquick2/plugins.qmltypes
	src/qml/debugger/qv8debugservice.cpp
	src/qml/qml/qml.pri
	src/qml/qml/qqmlcompiler.cpp
	src/qml/qml/qqmlcomponent.cpp
	src/qml/qml/qqmlcontext.cpp
	src/qml/qml/qqmldata_p.h
	src/qml/qml/qqmlengine_p.h
	src/qml/qml/qqmljavascriptexpression.cpp
	src/qml/qml/qqmlxmlhttprequest.cpp
	src/qml/qml/v4/qv4bindings.cpp
	src/qml/qml/v4/qv4irbuilder.cpp
	src/qml/qml/v4/qv4jsonobject_p.h
	src/qml/qml/v8/qqmlbuiltinfunctions.cpp
	src/qml/qml/v8/qv8bindings.cpp
	src/qml/qml/v8/qv8contextwrapper.cpp
	src/qml/qml/v8/qv8listwrapper.cpp
	src/qml/qml/v8/qv8qobjectwrapper.cpp
	src/qml/qml/v8/qv8qobjectwrapper_p.h
	src/qml/qml/v8/qv8sequencewrapper_p_p.h
	src/qml/qml/v8/qv8typewrapper.cpp
	src/qml/qml/v8/qv8valuetypewrapper.cpp
	src/qml/types/qqmldelegatemodel.cpp
	src/quick/items/context2d/qquickcanvasitem.cpp
	src/quick/items/context2d/qquickcontext2d.cpp
	sync.profile
	tests/auto/qml/qjsengine/tst_qjsengine.cpp
	tests/benchmarks/qml/animation/animation.pro
	tools/qmlprofiler/qmlprofiler.pro

Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
2013-06-24 11:48:46 +02:00
J-P Nurmi 7f526c4034 Add QQuickTextEdit::append()
This makes it possible to append text more efficiently than
appending to the text -property, and also avoids weird rich
text formatting issues with the latter approach.

Task-number: QTBUG-31575
Change-Id: Id621773588b94e36f8f0b9eb6b22590e9db62811
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2013-06-12 00:18:15 +02:00
J-P Nurmi a2e8e835fc Add QQuickTextEdit::hoveredLink
Change-Id: I9d75a97c86e047742514f942cdb91c70f1d7a9a2
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-06-07 21:47:57 +02:00
Simon Hausmann 5963aead75 More steps towards eliminating the v8 layer
* Changed the return type of the InvocationCallback from a v8 handle to a QV4::Value
* Removed v4 auto tests and fixed build of other tests

Change-Id: Ic927b925923ca8785170689a5c260969fd1cb794
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-05-07 12:28:58 +02:00
Frederik Gladhorn 7148a79775 Make sure that TextInteractionFlags get set.
The first time the function is called,
it could fail to set the flags.

Calling setSelectByKeyboard(true) would not actually
set the text interaction flags (was == on).

The test didn't detect it because it called setReadOnly
before setSelectByKeyboard.

Change-Id: Ia54cc782b6ad5a74f1d7029c92fa230116d034b0
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-03-19 20:19:09 +01:00
J-P Nurmi 70ce4ec6ae Add TextEdit::selectByKeyboard
The main use case is for enabling text selection by keyboard
for read-only editors.

Change-Id: Ieaa9af366fd0eaf863a104a2fdf33c9ddad38b10
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-15 17:59:34 +01:00
Frederik Gladhorn 11484c7f64 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	tests/auto/qml/debugger/qv8profilerservice/qv8profilerservice.pro

Change-Id: I2fd99ed8bd03302b9bbf31e6f21990f6455c4f1c
2013-03-14 09:30:12 +01:00
Frederik Gladhorn 8325f2dead Improve timer dependent tests.
tst_QQuickLoader::loadedSignal depended on
sharing the engine with simultaneousSyncAsync
and that function being run before it.

After each test run call clearComponentCache()
as that is important for caching of the network tests.

The test server would send the item after 500ms.
Sometimes the CI would be faster or slower.
Instead of relying on timing, simply call a function
when the reply should be sent.

Change-Id: Ifb0447041197e1cba103570597a62a2510d31aab
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-11 22:16:36 +01:00
Caroline Chao c4cbb1249f Tests: add autotests for TextEdit and TextInput
Check the selection is not cleared when the control receives
a focus out event with one of the following reason:
- Qt::ActiveWindowFocusReason
- Qt::PopupFocusReason

Change-Id: I38f4a4cba5e769f19de4e327d03be57a8d1d36a7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-07 11:58:50 +01:00
Frederik Gladhorn 15dc45ce10 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ia02971527a2d1a80c5624d69330428818aab3a41
2013-02-25 11:57:50 +01:00
Frederik Gladhorn b9e05ba421 Stabilize clicking in QQuickTextEdit test
This test would try to emulate mouse clicks
and not wait inbetween. That can lead to clicks
spilling over to the next mouse event.

Change-Id: I320f86453215190a1c694ba49c0fc3831dcb60b9
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2013-02-21 15:26:31 +01:00
Frederik Gladhorn 44b7d97d56 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I1656c712dfe99bc37d8ff21caa4ea51c3b375952
2013-01-23 18:28:44 +01:00
Frederik Gladhorn 742cff521a Stabilize QQuickTextEdit test
tst_qquicktextedit::remoteCursorDelegate was failing
because the test server served the the remote file too
fast. It seems like the test relied on a slow machine to
run it.
Instead pass the Delay option to make the server serve
the file delayed.

Change-Id: Id99feea07f2da3b2ea0aa6c07e9b548e8f81f18b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-23 12:11:43 +01:00
Gunnar Sletta 9c54d0ef8f Merge branch 'stable' into dev
Conflicts:
	src/qml/doc/qtqml.qdocconf
	src/quick/doc/qtquick.qdocconf

Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
2013-01-17 22:08:56 +01:00
Gunnar Sletta 1512835ee1 Do not force focus for non-focused windows.
If a QQuickWindow comes to screen but is not the focus window,
such as if it is a child window of another window, it should
not have focus by default.

Change-Id: If9015bbc179bb101178b3bc8de176a1c71c46023
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-01-17 13:52:16 +01:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Friedemann Kleint 920b949e51 Fix compiler warnings in declarative tests.
- Unused variables
- Missing enumeration values in switch
- truncation from double to float
- truncation from size_t to int
- Missing initializers
- Mix of operator & and bool |

Change-Id: Ib212aeea41befef193f12300a1d9814a60f183af
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2012-12-20 15:44:48 +01:00
Shawn Rutledge 55f6a109e9 Renamed QQuickItem::pos property to position
Abbreviated property names are less descriptive so we don't have
many of them.  Might as well be consistent.  QWindow::pos was already
renamed.

Change-Id: Ib52673e68e7dc902b2f8942dba6b899074b2538b
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-29 16:07:44 +01:00
Shawn Rutledge eba5128f66 All QWindow properties that have "window" in them have been renamed.
Depends on patch Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 in qtbase.

Change-Id: I9614cc2c7ed119c663b3f6f99267483e291e529c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-08 19:04:56 +01:00
Alan Alpert f21e9ba6ef Remove interim compatibility measures
Also update some variables in qtdeclarative which failed to update
rootItem->contentItem.

Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d3
Reviewed-by: Alan Alpert <416365416c@gmail.com>
2012-10-16 07:24:06 +02:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00