Commit Graph

99 Commits

Author SHA1 Message Date
Frederik Gladhorn f059e47a84 Extend tst_qquickwindow::mergeTouchPointLists
Change-Id: I199c57197fafed84ba0065765411d5239804d17f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-01 21:52:48 +00:00
Frederik Gladhorn bf2c880b2b Add mergePointerTargets to create pointer delivery list
This code joins lists of "target item" which are joins of where several
touch points should be delivered.

Change-Id: I15ab4b7f70b8930d15368bf4cba0893ab339fa2a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-01 19:17:20 +00:00
Frederik Gladhorn b4f05d7010 Let TestTouchItem::reset reset the event count
Change-Id: I37ddf4d45fd3457decb35a597876008ea9d09d11
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:47:04 +00:00
Frederik Gladhorn 435e3e95c2 Micro optimize tst_qquickwindow::touchEvent_basic
Change-Id: Ifd35eebaa8ba0aadcb15218a494c3e04167182ca
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:47:00 +00:00
Frederik Gladhorn c479032e6e Add minor extra check in tst_qquickwindow
Change-Id: If0343c36c747b419f949cff47a0f6a93bf73250d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:46:56 +00:00
Frederik Gladhorn 85e60c4591 tst_qquickwindow: Fix touch tests: add release
There is already a comment in the test that points that are pressed
must be released again.

Change-Id: I3190b9f98769f7a3838ff703e5557ee321c71604
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-28 12:21:30 +00:00
Frederik Gladhorn a5e7897dd7 Improve encapsuation of touch/mouse event specific things
This makes it easy to avoid casts when using the classes.

Change-Id: I27bd1244bffb3a7d2cdb4572c229333e4c499d9b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-21 14:14:56 +00:00
Frederik Gladhorn c856d877e7 Hierarchy for touch and mouse pointer events
Change-Id: Ie84e39918d9657b29df697be7b0e5198298c48ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-21 11:13:12 +00:00
Frederik Gladhorn ac79c052af Merge remote-tracking branch 'origin/dev' into HEAD
Change-Id: I931a7b264c68c40e16d9467b48173311aef74bd0
2016-07-18 15:31:45 +02:00
Shawn Rutledge cfe4e8b8dc tst_qquickwindow: make use of new QTest::createTouchDevice function
So gui-private API isn't necessary anymore.
Same as change 94324bd93f

Task-number: QTBUG-44030
Change-Id: I780cc1eedf9285336b96219a1fb1cd4016512701
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-13 19:08:44 +00:00
Shawn Rutledge 73eceacfac add tst_qquickwindow::eventPointCount
Change-Id: I552cf69fa179d8b1260a5502e37553fa57bf32cf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-13 14:56:18 +00:00
Laszlo Agocs b34296671b Change graphicsAPI to graphicsApi
Change-Id: I065f17abd1cb71cd8d6ead76abf7a544eb7a99c0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-01 10:32:12 +00:00
Andy Nichols ddbe4ec52b Fix build with QT_NO_OPENGL after rebase
Change-Id: Ia4243de07ec75030bb98f4f6d95f70d88e29fdba
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-08 20:04:37 +00:00
Laszlo Agocs 3fe2ecccc9 D3D12: Massage tst_qquickwindow and some sg semantics
Change-Id: Ic4cc9ae5c1df2ab7e1da50ac414dc3d7f264e691
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-08 20:03:24 +00:00
Laszlo Agocs e3716cdf88 Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ifb69f73ac805afe5e3c8708fa975b7d3c13a4e48
2016-05-07 13:26:27 +02:00
Andy Nichols 928915cabe Fix some test failures with QT_NO_OPENGL builds
Change-Id: I4154084b4a0e0709ee8cb39a856a37a611e2d537
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-06 19:17:28 +00:00
Andy Nichols 11e788c9a5 Get tests building when QT_NO_OPENGL is defined
Change-Id: I36f9e5e916b59657990d7613850ba76d2489a21e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-06 19:17:24 +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
Laszlo Agocs e188a3d864 Prefix GL-specific shader effect code
Rename the C++ sources and classes. The QML type name remains the same.

No changes in functionality.

The shader effect, node, material (and uniform animator and particles and
bits and pieces here and there...) are highly interconnected and do not
follow the usual design practices for Quick and the scenegraph and the
adaptation layer. Therefore while we aim for keeping full compatibility
for GL apps, other backends will likely get a different ShaderEffect item
implementation.

The C++ class QQuickShaderEffect itself is currently a dummy with an
unchanged API. It is not in use for now but forms the basis for the
implementation for other backends. This will be covered in future commits.

Change-Id: Ia39ce4b303f8f33e2f241d11e35fa62423e43127
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2016-04-13 09:22:16 +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
J-P Nurmi 6d8f6a7e40 Window attached property: fix notifier signals
The change notifiers must be emitted when an item's window is
reset. Otherwise any existing bindings don't get re-evaluated,
and in worst scenario one ends up with dangling pointers.

Change-Id: I6075957f1447bb8628d25bd822345e45837c027a
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-02 17:21:59 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Ulf Hermann b103f6a6b9 Merge remote-tracking branch 'origin/5.6' into origin/dev
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h
	src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
	src/qml/debugger/qqmldebugserviceinterfaces.cpp
	src/qml/jsruntime/qv4debugging_p.h

Change-Id: I82a4ce1bcd4579181df886558f55ad2b328d1682
2015-10-22 13:07:11 +02:00
Gunnar Sletta cac24aee6c Support alpha in QQuickWindow::grabWindow().
Change-Id: I2dd69745427d8f5e882303d2a4de3935ddca02e9
Task-number: QTBUG-48787
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-10-16 10:42:06 +00:00
Friedemann Kleint 06f11da5e1 Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.
Fix usage of API that is marked deprecated.

Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-02 04:19:22 +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
Friedemann Kleint e6846850a5 tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: Ib9f4c2486af23c47990be4b9e004b965de226dcc
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 18:45:21 +00:00
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
Oswald Buddenhagen 5931caca23 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	tests/auto/quick/qquickwindow/tst_qquickwindow.cpp

Change-Id: I272074fa2ca259439cae2f686325932f7f9d7c01
2015-07-20 12:08:27 +02:00
Ulf Hermann dd5bf45db6 Move the mouse to the right place before simulating a click
Otherwise the mouse event can be split in two and only a mouse move
will be immediately delivered. This problem was exposed by commit
66050f2ac875d451bec31e0d8ff507795b5b18d6 in qtbase.

Change-Id: I9d458bd446c754f566d1de412eb90a43f0686ab9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-05 05:51:12 +00:00
Ulf Hermann aa7fa616b1 Wait for window activation, not for exposal in key press test
The previous version only worked when simulated input events were
queued and thus incidentally delivered after the window activation
that follows the exposal.

66050f2ac875d451bec31e0d8ff507795b5b18d6 in qtbase made event delivery
synchronous for simulated input events.

Change-Id: Ieea3d1360b32f3466059a2ffe570d6dc633f81dc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-05 05:51:09 +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
Friedemann Kleint 1fd0cdc6a2 tst_qquickwindow: Prospective fix for instability of cursor test.
FAIL!  : tst_qquickwindow::cursor() Compared values are not the same
     Loc: [tst_qquickwindow.cpp(1444)]

Check that no windows are leaked in slot cleanup and fix all
leaking tests.

Position the window and enlarge it to fix the warning:

WARNING: tst_qquickwindow::cursor() Mouse event occurs outside of target window.

Add window titles to tests.

Replace QVERIFY(a == b) by QCOMPARE(a, b).

Change-Id: Ida892e8a8d7d5f40d4f50787608940dbffc7a29d
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
2015-06-03 13:08:10 +00:00
Alan Alpert 2c860b9c4d Remove testing of active window change on hide
We don't actually control where the window manager
assigns focus if the currently active window is hidden,
so don't test for specific behavior.

We can now remove the blacklist entry for this test.

Change-Id: Ie09fc91c6317f6bb2d4b91000641ef241556fddf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-02 21:11:18 +00:00
Frederik Gladhorn 26d172e550 Potentially stabilize tst_qquickwindow::touchEvent_cancel
By moving them well into the item, (50 instead of 10 pixels) there is
less risk of them not being delivered due to bad timing with window
activated.
Since we know that even qWaitForWindowActive sometimes returns before
the final positioning of the window, this is a sensible work-around
until testlib is fixed. In this test we care about the
process of cancelling a touch event, not where.

Change-Id: I74ad29535038995b38c913ddd09f462aa96a034c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-15 09:57:26 +00:00
Simon Hausmann 220f2cddad Stabilize QQuickWindow test
Various test functions use QTest::touch* and QTest::mouse* to synthesize
touch/mouse events. The synthetization relies on the QWindow to be globally
positioned (with regards to the window manager), as it performs a translation
of the supplied window coordinates to global coordinates. If this happens too
early in the window mapping process, we end up with wrong global coordinates,
that in turn mean that when the event is mapped back to the window coordinates
later, it has the wrong coordinates and not what the test expects.

qWaitForWindowActive tries to accommodate this case by waiting until the
positioning of the window is "complete", as opposed to qWaitForWindowExposed,
which returns as soon as we have a rendering surface.

The symptom in the CI system was that when this race condition hit, the y
coordinate of events was off by 28 pixels on Ubuntu machines, which appears to
be the height of the title or menu bar.

Therefore this patch changes test functions that synthesize events to use
qWaitForWindowActive.

Change-Id: Ia8ecff517f4eefb15068ca1c342ef6666681c362
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-04-21 10:41:45 +00:00
Miikka Heikkinen e036a0d80c Added a new render job stage: NoStage
NoStage allows scheduling jobs for immediate execution on the
renderer thread.

[ChangeLog][QtQuick][QQuickWindow] Added a render job stage: NoStage

Task-number: QTBUG-44953
Change-Id: I918c79f1d095bc27d911a88d81376d146a04313c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
2015-04-15 17:53:01 +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ørgen Lind 606ce564d8 Send hover events also to QQuickItem::childMouseEventFilter
childMouseEventFilter already gets touch events, and it is logical to
send the hover events which are essentially mouse events. By also
sending hover events to the filter it allows an item to track the mouse.

Existing implementations of childMouseEventFilter should not be effected
by more events being sent to it as checking for the event type should be
practiced in all overloads.

Change-Id: Ie00aceef05e41e4e8f6d80007343c5a5b9f566cf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-20 13:49:28 +01:00
J-P Nurmi 40f394ef2e Add Window.width and Window.height attached properties
[ChangeLog][QtQuick] Added Window.width and Window.height attached
properties

Change-Id: I3ef590a0d3e6fa660ed88992d5ae843deb09c7bc
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-01-09 21:40:52 +01:00
Friedemann Kleint 06fc202e81 Skip tst_qquickwindow::headless() when using ANGLE/Windows.
The test crashes frequently.

Task-number: QTBUG-42967
Change-Id: Ic17c6187bfa657154a9b04eb9c5b9a3de291cb1e
Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2014-12-02 09:56:04 +01:00
Shawn Rutledge 82c36e4ff0 QQuickWindow autotest: verify that onClosing can block close()
Task-number: QTBUG-40093
Change-Id: I800259f45d95736172d500494e68042180178e93
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
2014-11-07 13:48:43 +01:00
J-P Nurmi 77711c65c1 Add attached Window::contentItem property
This is essential to the Qt Quick Controls for implementing floating
text selection handle popups.

Change-Id: Ibae65110a5db6d65dacd197fef3ad567d11342dc
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-05 16:19:31 +01:00
Shawn Rutledge b1c8c4be50 QQuickWindow autotest: focus transferred to parent on window close
These bugs were fixed so XFAIL is no longer necessary in the autotest
(change da0c74550f0e8a21239896d6aead6e05f85eb695 in qtbase).

Task-number: QTBUG-33423
Task-number: QTBUG-39809
Change-Id: Ia89554b9f54aca7ef6c6ac6b474ca2bb9c0f5629
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2014-10-09 11:47:40 +02:00
Gunnar Sletta c270649190 Fix cleanup of non-threaded render loops.
They would unconditionally call cleanupNodesOnShutdown on hide(), but
QQuickWindow::sceneGraphInvalidated would only be emitted if this was
the last window being hidden, leading to an inconsistent state in the
application.

Since the non-threaded render loops do not support releasing resources
(there is one OpenGL context and one QSGRenderContext shared between
all windows) we delay cleanup until the window is destroyed.

This change also make the render loops track the windows until they
are destroyed, similar to what the threaded one does. The purpose of
this is to, in the case of dangling windows, only trigger invalidation
of the scene graph when the last QQuickWindow is destroyed through
QSGRenderLoop::cleanup().

Task-number: QTBUG-41210
Change-Id: I7e12a4f726ebb3e7935c822b6046abb3590c583a
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-24 15:03:37 +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
J-P Nurmi cf9b3c334d Remove QQuickWindow::glslVersion & glslIsCoreProfile
Superceded by the OpenGLInfo attached type
=> remove the API before it gets released

Change-Id: I7511fd28eb375eb3cd3cdd4bda6d82c1883e3094
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-08-13 07:59:32 +02:00
Laszlo Agocs f03892bbe9 Remove setDefaultFormat() from QQuickWindow
Replaced by QSurfaceFormat::setDefaultFormat().

Change-Id: If4e37b75ccb55d556d80b0079be89e5a521f6dbb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-11 13:19:38 +02:00
Shawn Rutledge 60ed6a433a Add Window attached property on Item
An Item sometimes needs to know a few things about the window
in which it is being displayed; this attached property can expose
them without needing to go up the heirarchy to find the window.
Instead of adding the QQuickWindow pointer as a property on Item
as in 8f49f50a16, having an attached
property means that it will not be found by introspection; and
it solves the problem that Window is in the QtQuick.Window module:
you must import the module to use the attached property, instead
of having access to a pointer whose type might not be defined
if you didn't import it.  The Window attached property is created
on-demand (so the memory cost adds up if you use it in too many
places); the tradeoff is that it can exist even when the item
is not yet being shown in a window, so bindings at startup work.
The API is purposely incomplete compared to that in QQuickWindow
so that we can introduce what is needed in a controlled fasion
over time.  For now we know of use cases for visibility, active
and activeFocusItem.

[ChangeLog][QtQuick][Window] Added Item.Window attached property

Change-Id: I649404cbd1383326678aa2144f790b2f2542dbbc
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-08-08 19:28:34 +02:00