Commit Graph

34 Commits

Author SHA1 Message Date
Friedemann Kleint c20463631d QtQuick: Remove usages of qWaitForWindowShown(QWindow *).
Change-Id: I722e20b2fb8d8c6c19c6f3f2cb16910d7433e9a4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 16:53:08 +02:00
Alan Alpert feb996e3ab QQuickCanvas renames
QQuickCanvas is now called QQuickWindow
QQuickCanvas::rootItem is now QQuickWindow::contentItem
QQuickItem::canvas is now QQuickItem::window
QQuickItem::ItemChangeData::canvas is also renamed window
QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow
The functions related to the color property have dropped the clear from
their names.

The first three changes have interim compatibility measures in place to
ease the transition.

Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-17 07:26:15 +02:00
Andrew den Exter 6e5944df63 Fix horizontal alignment of unwrapped text in TextEdit.
When the actual width of the text in a QTextDocument exceeds the
specificed textWidth it is aligned left irregardless of the text
alignment.  Compensate by doing our own alignment of the laid out
document.

Change-Id: I7df900316ffb3ecdf01ddb053480a60a8258182d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-16 02:30:52 +02:00
Andrew den Exter 867704b37c Fix TextEdit and TextInput test failures.
Use qWaitForWindowActive and instead of qWaitForWindowShown where focus
is required.

Also send events directly to the tested item, instead of getting a
pointer to the same object from QGuiApplication::focusObject() which
can return null and crash the test if focus is stolen.

Change-Id: I6b8956a3afc8ffa58394a957a35b64b1c0924596
Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-07-13 08:24:36 +02:00
Andrew den Exter e89a17af70 Add tests for instantiating cursor delegates in the Loading state.
Components created by QML are usually (always?) ready when assigned to
n property, but it possible for an externally supplied component to
still be loading, as in the test and the code handles it.

Change-Id: I2058e3479e2e711b52af2a0128e6e4c4c3ff7504
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-11 12:36:02 +02:00
Friedemann Kleint 02675dc020 Use qWaitForWindowActive() where it is required.
Prepare a change in qtbase in which the implementation
of qWaitForWindowShown() will be changed to
qWaitForWindowExposed() instead of qWaitForWindowActive().
Try to stabilize further tests by introduing
wait functions instead of calls to qApp->processEvents().

Change-Id: I9825885430d78be1610a3fe20023fad24aaacba9
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-07-09 17:36:35 +02:00
Andrew den Exter 4598939ee2 Speed up TextEdit construction time.
Defer setting content on the QTextDocument until componentComplete()
to avoid unnecessary layouts and move one time setup for the
text document from setContent to the constructor.

Reduces the construction time of a TextEdit with RichText textFormat
by about a third.

Change-Id: Idde0772063bf769cde984efddd68589c55a7431a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-09 09:05:32 +02:00
Andrew den Exter ac9b09d429 Add tests for triple click text selection in TextEdit.
Includes a minor behavioural fix for selectedText and getText so that
they return plain text strings for plain text content rather than the
raw text from QTextDocument which substitutes line break characters
with unicode line or paragraph separator character.  Rich text
documents still return the unicode characters.

Change-Id: I19a3a5bba2e4ebb0e6607e19c915a588a9a6c7db
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-04 03:29:58 +02:00
Andrew den Exter 6ede3b0138 Use the convential form for the selectedText notify signal name.
Rename selectionChanged to selectedTextChanged to address an apparent
difference to API between TextInput and TextEdit.

Task-number: QTBUG-19732
Change-Id: Ibc589c8b43567cb8d2f8c13f7366e2859c7f09d7
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-02 04:23:20 +02:00
Thiago Macieira 786dca63ce activeWindow is deprecated, use focusWindow.
This complements commit 2753e9a795,
which had begun fixing this issue, but not completed the entire
module.

Change-Id: I2d167e467c5553cfa49e04410aec9a7d98c7fc6e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-27 00:56:16 +02:00
Andrew den Exter 3721de405e Remove the open and closeSofwareInputPanel functions.
Functionality is provided by the global Qt.application.inputMethod
object.

Task-number: QTBUG-21449
Change-Id: I75c082bcbe44c8834ccaf966a3f9a09ab91ec290
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-22 08:18:15 +02:00
Andrew den Exter 5b83c3c27f Ensure the cursor delegate position is updated on text changes.
Change-Id: I7518aa5969ea45538feccb87f4c296db6b7d6944
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-06-05 03:22:18 +02:00
Gunnar Sletta 59ddedfb6f Reenable QQuickTextEdit::delegateLoading for Mac OS X
The render loop has been rewritten and the crash is no longer
reproducable.

Change-Id: I1402f7875075e4e552f7c430bbf1ca833d8dc601
Reviewed-by: Gatis Paeglis <gatis.paeglis@nokia.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-05-24 17:49:31 +02:00
Andrew den Exter 825f53b1a5 Fix incorrect text alignment in TextEdit.
QTextDocument always spans the full width of a TextEdit so the text
node shouldn't be offset by the x position of the bounding rect.

Change-Id: I882a44baeea4d054279cadc5632df6d8863caea1
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-05-17 02:39:08 +02:00
Andrew den Exter bd5e23a00e Defer construction of TextEdit/TextInput delegates.
Don't create instances of the delegate components until the item
gains focus, or the cursorVisible property is set to true.

Cursor delegates are typically small and relatively fast to create and
so won't have a significant cost during a one off focus in event,
but that cost can still add up when creating a number of TextInputs
or TextEdits at once.  If a delegate that is instantiated immeditately
is required it is possible to instead create a child item and bind to
the cursorRectangle and cursorVisible properties.

Change-Id: I5ec2b5b6a30e534aee3dd5a58c6a5ac0686f5ce2
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-05-14 00:51:15 +02:00
Andrew den Exter bf817782e6 Ensure the cursor rectangle is updated when preedit text changes.
Updating only when the cursor position changes isn't enough because
changing pre-edit text changes the width of the pre-edit area and
the x offset of all cursor positions within it.

Change-Id: I3c0a5e4ad4714a903ca84c1a25374491f34d95a0
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-05-03 07:04:03 +02:00
Pekka Vuorela 70e17b48e7 TextEdit to honor input direction on neutral text
Text with neutral direction, such as e.g. plain spaces, do not
need to make text left aligned on arabic input method.

Change-Id: I9aab5244ec47cf80fb2ba0f83e7087430eb2c7bb
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-04-27 13:47:34 +02:00
Pekka Vuorela 7c288f1a61 Fix TextEdit with right aligned text when size changes
Geometry change was avoiding updating size of the QTextDocument, thus
it was not able to right align before something else triggered size
change, e.g. a modification to the text. Also removed unnecessary
cursorRectangleChanged signal that was emitted when moving focus with
mouse.

Change-Id: I293fd5119473eb3def5acd1b3fbb951c12e14412
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-04-27 13:47:21 +02:00
Andrew den Exter 2a6e105f43 Fix bounding rects of text items.
Ensure the rectangles are correctly positioned with right
and center aligned text, not just sized correctly. Also add
padding to the clip rects so the cursor and styled text aren't
clipped at the item boundaries.

Change-Id: I03ef140589154ebd49b600b0a4c4fbeff845c10f
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-04-27 06:27:46 +02:00
Andrew den Exter a701746515 Propagate left key presses to the parent item when TextInput is empty.
Don't overwrite the ignore value once it's been set to true.

Task-number: QTBUG-25447
Change-Id: I7284147bc525d0971564570f0dd0599cec190905
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-04-27 03:45:16 +02:00
Girish Ramakrishnan 22408c96cd Use QInputMethod::isVisible instead of QInputMethod::visible
QInputMethod::visible will be removed in qtbase.

Change-Id: I16ffbe56d55a62ae6a905e3cfdab8ad245d24aa0
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-04-20 02:26:23 +02:00
Andrew den Exter 7bd68f6447 Ensure the cursor delegate position is correct when wrapping.
When inserting text into a TextEdit with implicit width and wrapping
the cursor delegate position has to be updated after the width is
expanded to the implicit width otherwise it will be positioned in a
wrapped location.

Change-Id: Ibcb709ec1b4f6827ea8ae919f2e0c932c7372869
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-04-19 06:16:28 +02:00
Pekka Vuorela adf3f8a72a QQuickTextEdit to trigger input method updates on selectAll()
Change-Id: I8642eca0e584b811308b73817e7decf2f392f1b5
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-04-12 13:32:21 +02:00
Andrew den Exter 368a3a736c Set cursorVisible to false when im cursor length is 0.
If the length of the QInputMethodEvent::Cursor attribute is 0 the
cursor is supposed to be hidden.  To ensure this and any other IM
state is reverted when the input method is reset send a empty
event to the editor when preedit is cancelled or removed and
count formatting or cursor changes when determining if the
input method is composing (i.e has state that needs to be reset).

Change-Id: Ifca69aa0c18776b1aef355ed6ae9aecc40b9d475
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-04-02 10:45:55 +02:00
Julian de Bhal 7d1996c1f4 Fix qquicktext tests to use QQmlComponent not QDeclarativeComponent
Change-Id: I340e01b9fa6d77343f25180abaa021454c7a0767
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-28 00:20:54 +02:00
Pekka Vuorela f32ae39ac4 Remove tentative commit from editors
Feature to be reimplemented simplified. Now using new
FocusAboutToChange event for using input method to commit stuff when
window is losing focus.

Change-Id: I81c96c36d9f0a1b38adb4324f3b892c33547cb50
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-03-26 10:36:31 +02:00
Andrew den Exter 336c338c9f Fix text wrapping and eliding with implicitWidth.
Update the implicitWidth of the item before continuing with the layout
rather than after it's completed this gives any bindings dependent on
the implicitWidth the opportunity to update the width before the layout
continues.

Task-number: QTBUG-22680
Task-number: QTBUG-24251
Change-Id: I61cd96ad9891b22d8b83937ad2c06719f88976b6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-22 04:06:12 +01:00
Andrew den Exter b6380adcf0 Don't overwrite text selections made in focus handlers.
Defer giving focus to TextInput or TextEdit until after other mouse
press handling has been performed, otherwise setting the cursor position
will overwrite any selection or cursor position set in the
on(Active)FocusChanged handler.

Change-Id: I6332642484de65138a444987b5a81be69c6f835f
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-03-21 06:52:37 +01:00
Andrew den Exter b93b4a7482 Make TextEdit word selection behaviour consistent.
Word selection initiated by a double click in QTextEdit only selects
a word if the drag point is closer to the end than the start
(assuming ltr selection) which can make it difficult to select small
words with touch input, as such the SelectWords mouseSelectionMode of
TextEdit selected a word if the drag point intersected any part of the
word.  Since we no longer have to retain compability for QTextEdit we
can settle on a single behaviour for word selection.

Change-Id: Iaabb7938a2b61b84a290a9ee41e407c83144b96f
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-03-20 06:49:30 +01:00
Andrew den Exter 7a9cd9d4fe Add additional key sequence tests.
Change-Id: Ie77a61a3ea0d1bdccd59dd519346db74bdf59c44
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-03-20 06:49:30 +01:00
Lars Knoll 16e29f30e3 Remove unneeded dependencies to QtWidgets and QtOpenGL
Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-12 17:04:36 +01:00
Michael Brasser 6cf36b2497 Fix tst_qquicktextedit.
Recent changes to mouse double-click handling mean that two
calls to QTest::mouseClick with the same position will result in a
double click, which was causing this test to fail.

Change-Id: I21e6aa7ab2221b6ea82b1afd13e36b7ba0aef8dc
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-12 17:04:28 +01:00
Matthew Vogt 0284817d6c Merge master <-> api_changes
Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
2012-03-05 11:39:54 +10:00
Matthew Vogt b855240b78 Rename QDeclarative symbols to QQuick and QQml
Symbols beginning with QDeclarative are already exported
by the quick1 module.

Users can apply the bin/rename-qtdeclarative-symbols.sh
script to modify client code using the previous names of the
renamed symbols.

Task-number: QTBUG-23737
Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-24 04:51:31 +01:00