Commit Graph

3064 Commits

Author SHA1 Message Date
Liang Qi 944b6878df Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I694ac053b53b669ef5578fd0074de5ce109f7a09
2016-05-04 16:14:45 +02:00
Simon Hausmann 8f7b36f899 Allow the use of uncreatable types for properties
It should be possible to write

    property SomeUncreatableType blah;

It should not be possible to write:

    property SomeUncreatableType blah: SomeUncreatableType {}

Task-number: QTBUG-36752
Change-Id: I2d1aa9f070a368f51844bbc0733d285022aab403
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-29 12:40:46 +00:00
Kai Uwe Broulik 7a0f3269b1 Add some ECMAScript 6 Number and Math methods and properties
This adds the Number.EPSILON property, the Number.isFinite, Number.isNaN,
and Math.sign methods introduced in ECMAScript 6.

Change-Id: Ib16408a63c202a4ef30a14334f65ac3a1a13cfaf
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-28 08:32:35 +00:00
Michael Brasser 26ecc82374 Add string search functions from ECMAScript 2015.
Change-Id: I46d5e42186d9f1b2994778de967610725b0e0633
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-25 14:15:48 +00:00
Robert Griebl 50a1cd3aac Fix changing QML Window visibility in Component.onCompleted
Creating a transient QML Window with visible set to false and then trying to
show() it in Component.onCompleted led to a race condition where the window
would be shown for a brief moment and then hidden again to enforce the delayed
initialization of the visible property. Fixed by tracking the value of the
visible property regardless of the 'completed' state.
The same problem was fixed for the visibility property.

Task-number: QTBUG-52573
Change-Id: I2a2ed7f359b951cb9189a7a6628d1d0cc1445d73
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-18 19:26:25 +00:00
Rafael Roquetto 2eb69af40a Fix compilation of qmldevtools/compile test.
C++11 was not automatically enabled, causing the build to fail.
load(qt_common) addresses the issue.

Change-Id: If54c5253942b057677035ed9c8785a2be535c41f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-13 22:00:42 +00:00
Simon Hausmann 8ca22ca7eb Fix invocations of methods taking a QByteArray
Since commit 3b7e2a69f7 when calling a slot that
takes a QByteArray with a parameter that is not a QByteArray, we would end up
passing an empty QByteArray. This is a regression as previously we supported
the conversion code path, i.e. when passing a QString it would be converted to
utf-8, through QVariant's conversion code path. This code path needs to be
re-activated by removing this "shortcut". The shortcut is not necessary as the
execution engine's toVariant() function also knows how to apply the conversion.

Change-Id: I0600d195c94fa4e1e0b7ab807f045f0da42f595b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-12 11:52:49 +00:00
Lars Knoll 3057b8c7e6 Convert the remaining runtime methods to new calling convention
Change-Id: I88ad3ca430508617d527715aa85ae8474ab7c621
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-11 12:27:39 +00:00
Liang Qi b9eca979f8 Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I48c493b537e65276107ed7ee029312e294947e8b
2016-04-08 23:42:37 +02:00
Michael Brasser 1148d3acea Add delayed property to Binding.
Provide a way to avoid potentially expensive or unexpected intermediate
values.

[ChangeLog][Binding] Add delayed property to Binding as a way to avoid potentially expensive or unexpected intermediate values.

Change-Id: I6aaca570859cc1344eeb9c9f19f32660e8c0b4e0
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-08 17:12:53 +00:00
Liang Qi dab3fa107f Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-04-08 11:16:24 +00:00
Liang Qi 68ba8fe3cc Merge remote-tracking branch 'origin/5.6' into 5.7
This change also fixes the build of two benchmarks, tst_affectors
and tst_emission.

Conflicts:
	src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
	src/qml/qml/ftw/qhashfield_p.h
	tests/benchmarks/particles/affectors/tst_affectors.cpp
	tests/benchmarks/particles/emission/tst_emission.cpp
	tests/benchmarks/qml/pointers/pointers.pro
	tests/benchmarks/qml/pointers/tst_pointers.cpp
	tests/benchmarks/qml/qmltime/qmltime.pro
	tests/benchmarks/qml/qquickwindow/qquickwindow.pro

Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
2016-04-08 13:03:25 +02:00
Simon Hausmann 1aa83ca46c Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I60b8a701b6d90f8572143cf760873f6b8b453c14
2016-04-08 10:45:53 +02:00
Friedemann Kleint a889bcb6c3 Blacklist tst_qquicktext::lineLaidOutRelayout() for MSVC 2015.
Task-number: QTBUG-51934
Change-Id: I2b7aa4846e013f4fa498b7b997de01f53e03d625
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-04-07 10:24:11 +00:00
Friedemann Kleint 5eef1ef329 tst_qquicktext: Ensure windows are cleaned up on test failure.
Use a QScopedPointer to guard them.

Task-number: QTBUG-51934
Change-Id: I622fe782e0bd232cb1cc6ffc16499830b94334f2
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-04-07 08:57:54 +00:00
Andy Nichols 60da655dff Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I57b06e2e98beb010a56dd0593d93e078ecf76eea
2016-04-05 12:11:13 +02:00
Edward Welbourne 7d7e28ce11 Purge sRGB chunks from PNG in tests.
Subjects each *.png file that matched grep -law "sRGB" to:
pngcrush -ow -brute -rem allb -reduce

Various tools grumble about sRGB tables in PNG images; and our
handling of them doesn't pay attention to these, so purging them
makes the images smaller with no loss to the images.

Change-Id: I9e4dc3aec97cd32bc8ac216fadeaf7669c49647c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-29 12:04:02 +00:00
Joerg Bornemann 7d8c941574 Remove empty .pro file
Change-Id: Ia85ced87b9cb0ad2093bdfc4abcf222929bc8bd5
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-03-24 19:40:31 +00:00
David Edmundson 9872999094 Handle duration of zero in QML animators
Handle a duration of zero in animators using the same approach as
animations.

Task-number: QTBUG-39766
Change-Id: I1628292ad259ec5ec5d3bb0770440efa5fa6dad0
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-17 14:36:30 +00:00
Eskil Abrahamsen Blomfeldt 17d435fd8b Add property for setting hinting preference on fonts
As screen density is rapidly increasing and user interfaces are moving
more and more towards using unhinted text as default, we have to make
it possible to select the hint level from Qt Quick as well. While
this is already partially covered by the unhinted QtRendering render type,
it is still interesting to be able to tweak the native rendering accordingly,
since this is a more precise rasterization. QtRendering also doesn't support
medium hinting.

[ChangeLog][Text] Added "hintingPreference" property to Text, TextEdit and
TextInput.

Change-Id: Ib99dbea24aba082481629deddde88c04cdeb8cdb
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-15 08:54:16 +00:00
Albert Astals Cid 201dec50b6 QQuickItemView::forceLayout: Also call layout when d->forceLayout
This way callers of forceLayout get a relayout if the dimension
of a delegate that affects the itemview content size has just changed
but the itemview content size has not been updated yet.

This is useful because sometimes in the QML side you want to do things when the
item view delegate size has changed but need the item view content size to be already updated.

Change-Id: I846984a841e8e14c84d7a700a7ff736196b60afb
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-03-11 13:30:34 +00:00
Shawn Rutledge 644a6a42a4 MouseArea: add source property to mouse event
It comes from the source() of the QMouseEvent which triggered it.
This makes it possible to distinguish real mouse events from those
that are synthesized from touch or tablet.

And for this we need to import QtQuick 2.7

[ChangeLog][QtQuick][MouseArea] Added mouse.source property
to enable distinguishing genuine mouse events from those that
are synthesized from touch or tablet events.

Change-Id: I568964f63981703bd23e05daac5288518f09d837
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-11 12:15:26 +00:00
Friedemann Kleint efa9e6fe9a Remove Windows CE.
Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses.

Task-number: QTBUG-51673
Change-Id: I33ab74f0c2ce9086c3610c5fa727f281197b6b55
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-10 11:27:18 +00:00
Michael Brasser 6cc908e25b Add Qt.callLater() function.
Calling the new Qt.callLater() multiple times in quick succession with the same
JS function as argument will result in a single call to that function, thus
eliminating redundant unnecessary calls.

Based on previous patches by Mathias Malmqvist <mathias.malmqvist@nokia.com>
and Chris Adams <chris.adams@jollamobile.com>

Change-Id: Ie71b60d4d48fa73d3deae723775cf36662d199ae
Task-number: QTBUG-22400
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-08 16:45:39 +00:00
Liang Qi e2b2be90f2 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-03-08 14:02:53 +00:00
Erik Verbruggen 350a74ec69 Particles: Shrink QQuickParticleData by 2 pointers.
Samegame creates about 23,000 particles, so this reduces the memory by
~180kb on 32bit, so ~360kb on 64bit.

Change-Id: I0581524ab232b474c5d43abeabd7ebf6174e740f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-08 09:37:21 +00:00
Liang Qi b8fd0ed3a4 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
2016-03-07 19:31:57 +01:00
Nobuaki Sukegawa 3b7e2a69f7 Convert QByteArray in C++ type to ArrayBuffer in QML and vice-versa
Change-Id: Ie4e29a443a17826a3ce4d1e1912bd35dc497ac78
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-05 08:26:29 +00:00
Dan Cape 9456832163 Add overwriteMode to QML TextEdit and QML TextInput
Overwrite mode was added to QML TextEdit and QML TextInput to match the
functionality provided by QTextEdit. Tests were updated as well to
ensure the mode functions as expected.

Task-number: QTBUG-26513
Change-Id: I1769159b298220107b09f9f13dc3af5f274715cc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-03-03 18:13:39 +00:00
J-P Nurmi 0e30dc40df AnimatedSprite: don't access deleted scene graph nodes
It’s a bad idea to store a scene graph paint node as a member variable.
First of all, it should not access the node outside updatePaintNode(),
that is, outside the render thread. Secondly, the node is owned by the
scene graph and may be nuked whenever the scene graph feels so. Some
creative re-parenting easily triggers a case where AnimatedSprite ends
up accessing a node that was already deleted by the scene graph.

Change-Id: I89205ac36333a2fcb094121afa61b6409fda5883
Task-number: QTBUG-51162
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-03-03 18:05:14 +00:00
Dan Cape 3f20c26f19 Fix QTextEdit/QQuickTextEdit undo issue - Part #3
Re-enable the undo tests since Part #2 has gone in and they won't fail
now due to code changes.

Task-number: QTBUG-38825
Change-Id: I8ad42a5ddc8bee0eb276b8db3ad3720011d3692e
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-03-02 19:00:19 +00:00
Jan Arve Sæther ba1491488e Add more tests for pixel snapping of sizes
Task-number: QTBUG-41216
Change-Id: I4456709ec5c4e61183fb4056a5f6d6bd9bd863d5
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2016-03-02 14:13:18 +00:00
Jan Arve Sæther b2ea9e760e Change test because of slight behavior change in the layout engine
The test was assuming that pixel snapping did not change the minimum
size hint of the layout. An upcoming patch to qtbase will change that.

Change-Id: I53bed57d086aa9ba9972188b014140c95d7669b9
Task-number: QTBUG-41216
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-03-01 23:31:49 +00:00
Jan Arve Sæther a3144972af Make test more data driven
Change-Id: Ia1c2d53c77da29337b4453046ddb3d526c7015e4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-03-01 23:31:28 +00:00
Robin Burchell 83cb2069ea QQuickText{Edit,Input}: Reset selection when becoming readOnly.
When read only, controls may not be edited or altered, and indeed, a read-only
control cannot acquire a selection (as it cannot be interacted with).
Leaving an existing selection breaks that implication, so clear it when becoming
read-only.

[ChangeLog][QtQuick][TextEdit/TextInput] If a control has a selection, it is now
cleared when becoming read-only.

Task-number: QTBUG-51115
Change-Id: Ife43b97ee3d6b780f09a938868c3ccb2f1b6e6e7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-01 21:47:49 +00:00
Liang Qi 1556df508b Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I26c440086c17c501063cf40c451f85f3649bffd0
2016-03-01 20:32:07 +01:00
J-P Nurmi 23712c5680 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro

Change-Id: I3ca8f0422828191b7e19539c25f31f2d048e9f18
2016-03-01 14:17:52 +01:00
Liang Qi 73e4458bbc Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I33de51677e9f14ce6b10d9c0bc06b4e8d4a5a695
2016-02-29 07:58:55 +01:00
Jan Arve Saether 974643829f Move QtQuick.Layouts to qtdeclarative from qtquickcontrols
This is in order for it to be available without having to install
Qt Quick Controls

Change-Id: I3f0d0dc108829947cd189b7861944e556e00cef3
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-02-26 13:18:27 +00:00
Liang Qi 944fd9d583 Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: Ia155ebbbfddff7051cee0f90079303dc25809d8d
2016-02-24 21:16:01 +01:00
Thomas McGuire 029003851b Properly signal errors when accessing lowercase enum values
Task-number: QTBUG-46758
Change-Id: I14e394021c231bda5552c8d1c98f20c903a62f12
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-24 12:11:27 +00:00
Nikita Krupenko d3f8a608e8 Validate Binding only when it is enabled
Not validate binding if it is disabled and validate when it became
enabled. This helps to get read of warnings about not existing property
that started to appear since 61ce37de40.

Task-number: QTBUG-48623
Change-Id: I4aa92896c04b146a79e606842c1d33661b3f5a70
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-24 10:44:01 +00:00
Kari Hautamäki fb2710a7f1 Determine QQuickItem::childAt() correctly
[ChangeLog][QtQuick][QQuickItem] Fix to wrong calculation of child at a
given point. Previously coordinates of width+1 and height+1 were counted
as a child. That caused a child Rect of (0, 0, 100, 100) to be reported
as a child at (100, 100), which is wrong (correct max coordinate is (99, 99).)

Task-number: QTBUG-41833
Change-Id: I6124a275a5dc1a38eab448235102d563e2a8b0ca
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-24 05:56:00 +00:00
Mitch Curtis 2b03ab6423 Expose Qt.application.font
This is useful in order to specify font sizes that are some multiple of
the default size (which is almost always guaranteed to be a sensible,
legible size). For example:

Text {
    text: "Large text"
    font.pixelSize: Qt.application.font.pixelSize * 2
}

Other options are:

- "<h3>Large text</h3>" - adds extra space below the text since it's a
HTML element, so not really useful if you want a decent layout.

- Hard-coding a pixel size. Works OK when used in combination with
Qt::AA_EnableHighDpiScaling, and so long as you guess the correct size
that works for each device/display you're targeting. Doesn't work
without setting Qt::AA_EnableHighDpiScaling.

- Using FontMetrics/TextMetrics. Works fine, but is a bit verbose.

- Use an empty Text element. Creates an unnecessary item. Was
superseded by FontMetrics/TextMetrics.

- defaultPixelSize/implicitPixelSize and
defaultPointSize/implicitPointSize. There are already font-related
properties outside of the font grouped property, so this wouldn't be
out of place, but the API is already quite large.

[ChangeLog][QtQuick] Added Qt.application.font property.

Change-Id: I2d0899f2a6b717aab9afcea59f42fbf3715d8406
Task-number: QTBUG-50298
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-02-23 13:57:08 +00:00
Liang Qi 4e7f570f92 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/quick/items/qquickitem.cpp
	tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
	tests/auto/quick/qquicklistview/tst_qquicklistview.cpp

Change-Id: I3cf47faa2fe567d62fffd985aeecbefe5811cc42
2016-02-19 12:59:04 +01:00
Liang Qi 7a3dd4c1ae Merge remote-tracking branch 'origin/5.6.0' into 5.6
Change-Id: Ib4eb5c3572cb5ec11eb744572ec796dc7e70456d
2016-02-15 08:08:32 +01:00
Gabriel de Dietrich 0fab5761d5 GridView: Sanitize visible items after model insertion
This is basically the same patch as 35d8d060b8, but this
time for GridView instead of ListView.

The major difference is that GridView seems to do the right thing
when the model insertions happen after the visible index. That
explains the missing part of the patch in applyInsertionChange()
as compared to the same function in QQuickListView.

Also, QQuickGridView auto-tests are a bit more robust than their
ListView counterpart. So no changes were necessary to existing
test cases.

Task-number: QTBUG-48870
Change-Id: I19b24c4d84a1a4cef4fdb3ddd3381d0c6b93a76a
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-13 00:15:45 +00:00
Gabriel de Dietrich 13f94c3869 Factor out testing code for QTBUG_48870_fastModelUpdates
This is going to be reused for QQuickGridview's counterpart.

Change-Id: I3eaf272229b0e45dfc8c0b78ba94d57c72f9cc5d
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-13 00:15:37 +00:00
J-P Nurmi 04d4dca69d Add Window.window attached property
The Window attached property exposes all kinds of window attributes,
but not the window itself. Being able to access the window is often
useful for various purposes. For example, in QML TestCase, to be able
to access the window of the TestCase so that one can call various
slots such as requestActivate().

Change-Id: Id03c9f277bb17810b41a60957011ccf07399e149
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-12 15:33:53 +00:00
Liang Qi 20a51e87fd Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	.qmake.conf

Change-Id: I356ec83cf687bd2833f9a7c5e820d56b1efa8979
2016-02-12 10:53:43 +01:00