Commit Graph

1272 Commits

Author SHA1 Message Date
Mitch Curtis 2556bfdab4 Positioners: allow distinguishing between implicit/explicit child size
In Qt Quick Controls 2, we plan on using positioners to layout an icon
next to text in a button, for example.

Consider the following example:

    AbstractButton {
       id: button
       text: "Button"
       contentItem: Row {
           Text {
               text: button.text
               width: parent.width
           }
       }
       background: Rectangle {
           radius: 5
           color: "lightsteelblue"
           opacity: button.pressed ? 1.0 : 0.8
       }
    }

In Qt Quick Controls 2, implicit size propagates "up" from the
delegates/building blocks to the control, whereas explicit size
propagates "down" from the control to the delegates/building blocks.
Providing a reasonable implicit size is important to make controls
behave well in layouts, etc., and the internal building blocks must
follow the size of the control to retain sensible looks when a control
is resized.

In the example above, contentItem needs to have a "natural" (implicit)
size representing the ideal fit of the content, but it needs to respect
the explicitly provided size from the control too.

With the current behavior, as the explicit width of the Row is 0, the
Text item (via the width binding) sets explicit width to 0, and Row
uses that explicit width rather than the implicit width, thus, Row here
will have an implicit width of 0, which is not what the control wants.

This patch:

- Allows subclasses of positioners to set
  QQuickBasePositionerPrivate::useImplicitSize to true in order to tell
  positioners to use implicit size rather than explicit size. This is
  not exposed as public API, as this behavior is typically not
  something desirable in the positioners themselves. For example,
  Row { Rectangle { width: 100; height: 100 } } would have an implicit
  size of 0, as Rectangle has no implicit size.
- Adds QQuickImplicitRow and QQuickImplicitGrid, which are private
  subclasses of their respective positioners that simply set
  useImplicitSize to true in their constructors.
- Exports the wrappers privately so that they can be registered by
  other modules as QML types.

Change-Id: Ie68aabd7fbf6c76375badf6e338f2f238f3fc392
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-02-23 13:45:52 +00:00
Lars Knoll 802bebd566 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I372850330c1d92edc5b07596759f0db3a59082a8
2017-02-14 08:21:39 +01:00
Tor Arne Vestbø f145f33d52 Rename Window.targetScreen to screen, and pick up changes to the screen
The screen property can be used for both setting the initital screen, and
for reading out the current screen, so 'targetScreen' was not an ideal
name for this property.

Change-Id: I1b617085b1e8e0e437355740be5d3cee9379c47f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-02-11 12:12:38 +00:00
Laszlo Agocs 24d4e164ad Re-enable tst_qquickwindow::headless
With the ANGLE update in 5.7 the root cause may have been fixed.

Task-number: QTBUG-42967
Change-Id: Iec2faf5b7f5ed2c5f116a9c10ce35ed704c46d31
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-02-10 13:58:28 +00:00
Eskil Abrahamsen Blomfeldt 659d5202f9 Add fontInfo property to Text
This provides a way to determine which font will actually be
used to presenting the text, which can be especially useful when
not using a fixed size font (the font info will then expose the
actual font size used by the Text element.)

[ChangeLog][QtQuick][Text] Added fontInfo property to Text type,
providing a way to query properties of the actual font used
for presenting the text.

Task-number: QTBUG-51133
Change-Id: I5860fb1bd25ac5734713f49c8482428f2d531d22
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-31 08:22:14 +00:00
Liang Qi 0076c44d39 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/quick/util/qquickutilmodule.cpp
	tools/qmllint/main.cpp

Change-Id: Ic2283f88c293ca7fc776de3e83eb4c7812309d8a
2017-01-26 00:34:21 +01:00
Jan Arve Saether c4067b42f7 Do not leak the item, and use a QScopedPointer to guarantee cleanup
Change-Id: Ib4160f418686cef6d85dfd64657d25836f66778e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-23 09:02:58 +00:00
Oleg Yadrov 7ee15ecdd9 PathAnimation: fix bug when PathSvg or PathLine is the last item in Path
Both QQuickPathLine and QQuickPathSvg inherit QQuickCurve class which
has “x” and “y” properties that return qreal type, but internally they
are stored as QQmlNullableValue<qreal>. At the same time, if any of them
is not specified explicitly, its getter returns 0.

QQuickPath processes QQuickPath%Type% objects and produces a
QPainterPath which later used by QQuickPathAnimation.
QQuickPathAnimation only created a QAbstractAnimationJob if
QQuickPath::hasEnd returned true, and hasEnd returned true only if both
“x” and “y” were specified explicitly.

All that in conjunction led to the situation when if you had either
- a PathLine with unspecified “x” or “y”; or
- a PathSvg
which was the last (or the only) path element in your Path,
PathAnimation would not start.
This patch removes hasEnd check, it should be safe to do because
QPainterPath is always valid anyway due to the fact QQuickCurve::x()
and QQuickCurve::y() return 0 if they have not been not explicitly set.

Task-number: QTBUG-57666
Change-Id: Id320aaeb5aff0964d6493b7b80d5d9a7d36acce8
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-20 00:13:24 +00:00
Oleg Yadrov 03505d6eb7 StackLayout: propagate rearrange() call to child layouts
Task-number: QTBUG-57867
Change-Id: I0190b892e2bc2966b82a0dbd99e53fd9d6848957
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-01-19 23:02:54 +00:00
Albert Astals Cid 7a8842460d Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAG
Change-Id: Ibedd0d0c23cf194ea02a229ab643450dbefd40aa
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-19 11:54:27 +00:00
Robin Burchell 373cdc297f Remove remnants of blackberry platform support
The last remnants were removed from qtbase in 5.7 making this all dead code,
so match here too.

Change-Id: I10f3f1c614562f2a97ade7cdf5002065d6f79e07
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-16 17:10:14 +00:00
J-P Nurmi 8eada7ae7d ListView: allow flicking to both directions
Previously flicking was restricted to the orientation of the ListView.

[ChangeLog][QtQuick][ListView] Made it possible to enable horizontal
flicking in a vertical ListView, and vice versa. The only thing apps
must do is to specify the desired flick direction and the content
width (vertical ListView) or content height (horizontal ListView),
which is not calculated by ListView.

Change-Id: Ic370e57f5d18679940d48e7a2c20c200b2ef36d1
Task-number: QTBUG-52553
Task-number: QTBUG-56501
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-16 15:46:28 +00:00
Robin Burchell 2c826af7c3 tests: Remove some vestigial references
qtdeclarative hasn't relied on qtwebkit for a long time (since
fbfb27a44a &
56d34a653a as early as 2011!).

Change-Id: If02572617034bf2c3eecbf081b96b1ed0ad65b45
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-16 15:13:54 +00:00
Robin Burchell ed024294c5 Fix imageSource and svg tests after change to how QtSvg interprets image size
These tests were blacklisted after QtSvg/4bd5d6ced07d2d0e643a13e7cebb228c521d2046.
in order to integrate qt5.git. Now, fix the tests to match the new
behavior, and remove the blacklisting.

Task-number: QTBUG-58082
Change-Id: I77abe995095ee52978c5957e49e1547b3af7708b
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-15 08:35:58 +00:00
Liang Qi 60300fda46 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	.qmake.conf

Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
2017-01-14 22:17:32 +01:00
Robin Burchell e85ebe01b6 Blacklist imageSource and svg tests
QtSvg changed how the dimensions of an SVG are determined in
4bd5d6ced07d2d0e643a13e7cebb228c521d2046. These tests assume the old
behavior at present, so blacklist the tests so qt5 integration can
proceed.

Task-number: QTBUG-58082
Change-Id: Ia579fbe6736932c081f9873d84bea4c01a975bad
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-13 22:28:49 +00:00
Jan Arve Saether 342c72da64 Avoid needless notifications when destroying layouts
When deleting a layout with children, it ends up in ~QQuickItem(), which in
turn will call setParentItem(0).  setParentItem(0) will in turn call
setEffectiveVisibleRecur(), which will recurse down all its descendants.
Therefore, deleting a top level layout might trigger item change listeners
for *all* its descendants, not only its direct children.

This behavior might even cause crashes: The visibility changes will then
trigger an invalidation of the layout, which will propagate up the parent
hierarchy, and potentially call invalidate() on a partially-destroyed
layout, which then might crash.

Change-Id: I48e11d57f69e9011ced6c3a0b51e3d89b24ad5c1
Task-number: QTBUG-55103
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-12 09:56:40 +00:00
Liang Qi a16f2cc391 test: fix tst_QQuickGraphicsInfo::testProperties()
This also reverts commit 26051fd572.

Task-number: QTBUG-58039
Change-Id: I0b9146a64f1a112f5c059b2e29e874631c81d12c
Reviewed-by: David Faure <david.faure@kdab.com>
2017-01-12 06:49:49 +00:00
Robin Burchell 3294d1b291 tst_touchmouse: Have a go at some stabilisation & improvements
* Use QScopedPointer to own views, preventing leakage (was a problem in
  a few of these tests, e.g. pinchOnFlickable/flickableOnPinch/mouseOnFlickableOnPinch)
* Only qWaitForWindowActive, as the tests aren't doing anything
  graphical, they don't need an expose event, which means less waiting
* Use the test utilities to center the windows on screen to make sure
  they are not under desktop chrome & have a non-null position.
  If position is 0,0 that means window->position().isNull() is true,
  so qWaitForWindowActive will wait for its entire timeout: 5 seconds.
  This means no "manual" tweaking of geometry anymore: the position is now taken
  care of by the test utilities, and we let the root QML item size determine the
  window size.
* Move the mouse away from the window using the test utilities.

Done-with: Shawn Rutledge
Change-Id: I4ac6a0d56067c57ef51f186fe3cd118cab056ff2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-11 23:10:27 +00:00
Oleg Yadrov 0252d05d06 PathView: fix crash on path remove
There was no check if new path is a valid object

Task-number: QTBUG-53917
Change-Id: I2fd9534c1d34633243d16eda56a2b07e18dabe16
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-11 18:19:02 +00:00
Liang Qi 26051fd572 Blacklist tst_QQuickGraphicsInfo::testProperties() on linux
Task-number: QTBUG-58039
Change-Id: Ib7a371c6dec7748b9c5257b6cf4dfb61efc7aa88
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-01-10 14:07:00 +00:00
Oleg Yadrov f70066e95e Make it possible to call grabToImage() on Window.contentItem
Window.contentItem was not associated with any QQmlContext and
QQmlEngine. A valid pointer to QQmlEngine is needed for callback
function execution.

Task-number: QTBUG-57175
Change-Id: Iab7730bfc8860521ff2e8c1631a11d0e1fe0cf94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-01-02 07:01:15 +00:00
J-P Nurmi 3f6d82715d Add TextInput::textEdited()
[ChangeLog][QtQuick][TextInput] Added textEdited() signal to
distinguish user edits from programmatical text changes.

Change-Id: I1d78499e3e11f9f1cab80ce3b0a6d9f2713219f4
Task-number: QTBUG-57203
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-12-30 17:46:15 +00:00
J-P Nurmi bb594453f9 Flickable: add horizontal/verticalOvershoot properties
[ChangeLog][QtQuick][Flickable] Added horizontalOvershoot and
verticalOvershoot properties that can be used for implementing
boundary actions and effects.

Task-number: QTBUG-38515
Change-Id: I06379348a67d03507b56788d6fc7020bbb2d375f
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-12-29 11:43:59 +00:00
Liang Qi 9a272ad185 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	tools/qmlimportscanner/main.cpp

Change-Id: I01e17581f6691a03f83788773364d0cf96319514
2016-12-25 18:35:38 +01:00
Mitch Curtis 7b7322c497 ListView, GridView: fix missing keyNavigationEnabled property
Before this patch, this code:

import QtQuick 2.7

ListView {
    keyNavigationEnabled: true
}

Would cause this error:

"ListView.keyNavigationEnabled" is not available in QtQuick 2.7.

This is because ItemView was missing a revision:

qmlRegisterUncreatableType<QQuickItemView, 7>(
    uri, 2, 7, "ItemView", QQuickItemView::tr("ItemView is an abstract base class"));

Task-number: QTBUG-57621
Change-Id: Ia00cb7446a0d83278760f3aa361db5a864661bc6
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-12-20 11:51:24 +00:00
Mitch Curtis c4eefa4a8d Keys: add shortcutOverride signal
This allows an item to accept the shortcutOverride event, preventing
e.g. Shortcut from stealing key events.

The original use case that prompted the creation of this patch was
using a Popup from Controls 2 to create a keyboard shortcut editor.
When the user wanted to cancel the shortcut that they were editing,
they could press escape, but Popup would grab the shortcut and close
itself. As the test case demonstrates, the same problem occurs with
the Shortcut type in Qt Quick.

[ChangeLog][QtQuick][Keys] Added shortcutOverride signal to Keys
attached object to allow prevention of e.g. Shortcut from stealing
key events.

Task-number: QTBUG-57098
Change-Id: I594e4ea17ec417d8c7d93c6cf347c1a1a2e62b93
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-12-18 14:57:54 +00:00
Olivier JG 17a1c12a45 Add pressAndHoldInterval to MouseArea
Introduce pressAndHoldInterval to allow setting the pressAndHold delay
per-MouseArea.

[ChangeLog][QtQml][MouseArea] Introduce pressAndHoldInterval property,
which controls the elapsed time before pressAndHold is emitted.

Task-Id: QTBUG-47662
Change-Id: Ic2173335033a6ed0d4b652333020f030de63a8e7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2016-12-16 18:28:44 +00:00
Liang Qi 0e80d28aa5 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
	src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
	src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
	src/qml/qml/qqmlimport.cpp
	src/quick/items/context2d/qquickcontext2dtexture_p.h
	tools/qmleasing/splineeditor.h

Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
2016-12-14 19:01:23 +01:00
Friedemann Kleint 260f45d539 tst_QQuickPathView, tst_QQuickListView: Fix compiler warnings
Fix warnings about assignment used as truth value in Q[TRY_]VERIFY
by generally pulling out the assignment in case of QVERIFY and adding
parentheses in case of QTRY_VERIFY. Also fix 2 cases in which apparently
QTRY_VERIFY(find()) was intended.

Fixes warnings:
tst_qquickpathview.cpp: In member function 'void tst_QQuickPathView::creationContext()':
tst_qquickpathview.cpp:1637:100: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquickpathview.cpp: In member function 'void tst_QQuickPathView::currentOffsetOnInsertion()':
tst_qquickpathview.cpp:1688:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquickpathview.cpp:1700:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquickpathview.cpp:1712:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::sectionsPositioning()':
tst_qquicklistview.cpp:2392:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::itemListFlicker()':
tst_qquicklistview.cpp:2979:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2981:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2983:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2988:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2990:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2992:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2997:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:2999:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:3001:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::creationContext()':
tst_qquicklistview.cpp:5339:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5341:98: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5343:98: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5345:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::unrequestedVisibility()':
tst_qquicklistview.cpp:5626:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5628:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5631:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5633:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5636:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5638:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5640:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5642:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5650:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5652:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5663:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5665:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5668:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5670:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5673:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5675:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5677:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5679:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5687:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5690:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5692:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5695:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5697:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5699:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5701:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5707:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5709:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5711:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5713:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5719:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5721:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5723:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5725:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5731:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5733:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5735:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5737:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5743:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5745:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5747:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:5749:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::displayMargin()':
tst_qquicklistview.cpp:7255:100: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:7259:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::negativeDisplayMargin()':
tst_qquicklistview.cpp:7292:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:7295:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:7298:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qquicklistview.cpp:7303:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Change-Id: Ic069c8336cf15db75860c6f79dfd215a5592ca79
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-12-08 16:27:12 +00:00
Lars Knoll e579076bb3 Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few
mis-spelled macros and invalid usages.

Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-29 10:10:27 +00:00
Mitch Curtis 0cab78f2b2 tst_qquicktextedit: remove useless call to image.save()
Change-Id: I433ba9ef0dc403e7b15eeaee1fd682cf443870cf
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-11-28 09:16:24 +00:00
Liang Qi 5d4cbf4094 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/qml/jsruntime/qv4object_p.h

Change-Id: Iff4d3aba7710a999b8befdc493cbe959e1ce02f9
2016-11-23 10:49:37 +01:00
J-P Nurmi a7fd83cd0c Shortcut: add support for multiple key sequences
[ChangeLog][QtQuick][Shortcut] Added support for multiple shortcut
sequences. Previously it was possible to specify a single sequence
that could consist of up to four key presses. Now it is possible to
specify multiple sequences that can each consist of multiple key
presses.

Change-Id: Id12f25da2f352cc542ec776049d8e81593951d41
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-11-16 17:33:41 +00:00
Simon Hausmann b7a8b5a284 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/qml/jsruntime/qv4string.cpp

The conflict resolution for qv4tsring.cpp is to essentially omit the
change of commit 64714ea431 as the code in
5.8 already uses the add/mul_overflow functions.

This merge also reverts commit f4ac007f4a
as we can deal with dead store elimination now.

Change-Id: Iee08c87cbe1a2ff23a73ce621d56262b4e007c56
2016-11-15 16:44:16 +01:00
Mitch Curtis 769002ffe4 TextEdit: set cursor delegate's height to match the selected font
RichText can have blocks of text with varying font sizes, so we must
ensure that the cursor delegate's height is also set when it's moved to
a different position in the text.

Change-Id: I00691a94a2360c7d3272571fc4ba0da28b01006a
Task-number: QTBUG-54934
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-11-12 16:15:30 +00:00
Erik Verbruggen 8161a92b5f Quick: Do not calculate the difference in a geometryChange
This difference is only used by the ListView, so calculating it and
storing it (on the stack) introduces a penalty for all items. As the new
geometry is already applied, the old geometry is passed along. This has
the added advantage that the ListView does not have to re-calculate that
either. This fixes a performance regression.

Change-Id: Id5e67bb663a5b11a55ec15ff24ca5b213d1fcef5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-11-10 14:53:34 +00:00
J-P Nurmi da5083c11d Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	tools/qmljs/qmljs.cpp

Change-Id: Ifa9e74bdb780eaff22fbc9ba1c514d0078a3fb29
2016-11-03 11:01:45 +01:00
Liang Qi 9d085bf002 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	tests/auto/quick/qquicktextedit/BLACKLIST

Change-Id: I0b9e5bea5da5d2666887c202e62d889b4aa56900
2016-10-27 12:27:54 +02:00
Liang Qi 6b58ce5251 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/quick/items/qquickwindow.cpp
	tests/auto/quick/qquicktext/BLACKLIST
	tests/auto/quick/qquicktextedit/BLACKLIST

Change-Id: I8bd68b0b5e853b7908791d2cbddd18dd527c76ae
2016-10-27 09:56:20 +02:00
J-P Nurmi 93d7c26653 QQuickShortcut: allow setting a custom context matcher
This allows Qt Quick Controls 2 to register a shortcut context matcher
that makes shortcuts behave well with QQC2's item-based popups, which
QQuickShortcut is not aware of.

Task-number: QTBUG-56562
Change-Id: Ia2518fd6ac7140f60aa38c7d9af557007e9db23b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2016-10-26 13:20:05 +00:00
J-P Nurmi 55b9c7c1bd Make tst_qquicktextedit::mouseSelection() pass
Since qtbase commit beef975, QTestLib avoids generating accidental
double click events by adding 500ms timestamp delta on release events.

The test requires a press-and-drag-and-release type of sequence with
double and triple clicks. The triple-click case is handled fine with
QTest::mouseDClick() + press + move + release, but the double-click
case is using QTest::mouseClick() + press + move + release and relies
on the accidental double-click event generation that QTestLib now
deliberately prevents.

I can't think of a nice way to inject the move event in the middle of
a double-click sequence generated by QTest::mouseDClick(), so we just
send the missing double-click event by hand.

We can also remove the QStyleHints::mouseDoubleClickInterval waits,
which were there to prevent the aforementioned accidental double click
events that can no longer happen. This reduces the total execution
time of mouseSelection() by roughly 90%.

Task-number: QTBUG-50022
Change-Id: I252e87d6a49ea86a44cfa347a29eebee12fd36d1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-24 10:39:01 +00:00
J-P Nurmi bb8ae2d0a0 tst_qquicktextedit: remove mouseDoubleClickInterval wait
Since qtbase commit beef975, QTestLib avoids generating accidental
double click events by adding 500ms timestamp delta on release events.
Thus, now we can remove the QStyleHints::mouseDoubleClickInterval wait,
which were there to prevent the aforementioned accidental double click
events that can no longer happen. The default inverval is 400ms, so
this saves us nearly half a second on most platforms.

Change-Id: I7a670b70c012ac027dc951ebafdf5e7d53b89ce9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-10-23 18:00:18 +00:00
J-P Nurmi 20bfb6a7d6 tst_qquicktext: remove bogus blacklisting
There's no such test as mouseSelection in tst_qquicktext.

Change-Id: I09bf4c61b53acd9811e020379a29c80fce9fe48b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-23 18:00:09 +00:00
Liang Qi 2ff13bdf69 Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I171c7dbb6a74fe743c2eec63e86e9c0bef7c7dfd
2016-10-22 21:21:39 +02:00
Jan Arve Sæther 2369fab86c Relax assumptions of the value of the touchMouseId
This is needed in order to be able to integrate a change that mangles
the device identifier into the touch point id in qtbase

Change-Id: I7675ade377da51f8da31830c7d43875487680845
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-20 17:41:35 +00:00
Liang Qi f5da1a9261 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/quick/items/qquickitemsmodule.cpp
	tests/auto/quick/rendernode/tst_rendernode.cpp

Change-Id: I90582df69feb95a4e4aafb0b9793c23714654f19
2016-10-20 08:28:16 +02:00
Benjamin Terrier 82a5bb18d2 Add QQuickApplication::displayName property
[ChangeLog][QtQuick] Add Qt.application.displayName property.

Task-number: QTBUG-53091
Change-Id: I810eb381ac8e6151cbc07f3f66f2e661ff3e09f4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-10-18 18:00:43 +00:00
Liang Qi f04c2c40fd Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/qml/jsruntime/qv4variantobject.cpp
	src/qml/types/qquickworkerscript.cpp
	src/quick/scenegraph/util/qsgdefaultpainternode_p.h
	tools/qmljs/qmljs.cpp

Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
2016-10-18 08:33:26 +02:00
Mitch Curtis dd313c4c5e Fix tst_rendernode::renderOrder() on high DPI displays
When QT_SCALE_FACTOR is 2, fb.width() is 400 instead of 200, for
example.

Change-Id: Iec02d7cfd49d29fceda6645377b75e4607cceb6f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-17 20:42:13 +00:00