Ulf Hermann [Wed, 3 Sep 2014 17:28:35 +0000 (19:28 +0200)]
Select specific features to be recorded when profiling QML
Some features, like the memory profiler, create huge amounts of data.
Often enough, we're not actually interested in all the data available
from the profiler and collecting it all can lead to excessive memory
consumption. This change enables us to optionally turn various aspects
of QML profiling off.
Task-number: QTBUG-41118
Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Gunnar Sletta [Tue, 9 Sep 2014 05:12:31 +0000 (07:12 +0200)]
Fix debug output from renderer.
It was wrong when we ran without depth buffer or when we used the
separate ibo code path.
Change-Id: Ie6e4bfc99ee2a4a593e45be7d9af9af17896bcba
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Mon, 8 Sep 2014 10:38:02 +0000 (12:38 +0200)]
Snap native glyphs to pixel grid in vertex shader.
The implementation relied on the full matrix, but did not
set the RequiresFullMatrix flag. Setting the flag would
have serious negative performance impact as it prevents
batching, so we solve it in the vertex shader instead.
Task-number: QTBUG-38702
Change-Id: I0c245ea9e18b0b29dd9e3073a2648a7f4e061685
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Lars Knoll [Tue, 9 Sep 2014 13:39:11 +0000 (15:39 +0200)]
Fix setUTCXxx methods in Date
The methods where converting doing a localtime->UTC
conversion even though the input was already in UTC.
Task-number: QTBUG-38448
Change-Id: I4409275fade0dd2a677af2293edc87445f853879
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 8 Sep 2014 12:06:22 +0000 (14:06 +0200)]
Fix roundtrip conversion between JS var and QVariant
Always convert null to a QVariant(VoidStar) as documented in
QJSValue. Make sure the reverse conversion will lead back to
a null JS value.
Adjusted two test cases that expected an invalid QVariant when
setting the property to null, and added test cases for the
correct conversion.
Task-number: QTBUG-40880
Change-Id: I6eb01f0067f2c89779c53fd2cd0a1193047ed2cc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Wed, 10 Sep 2014 11:18:39 +0000 (13:18 +0200)]
Fix failing assertion when compiling self-referencing QML singleton
When a QML singleton file accesses itself, we would hit incomplete
type data.
Task-number: QTBUG-41220
Change-Id: Id0bd5fd71cf9be21f7e4ad8527fa8724a718d702
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Simon Hausmann [Thu, 11 Sep 2014 07:53:39 +0000 (09:53 +0200)]
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Mitch Curtis [Tue, 9 Sep 2014 13:31:15 +0000 (15:31 +0200)]
Improve KeyNavigation documentation.
Change-Id: I07e66deb4b21eca191c17532749eeccd33d83fb0
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Mitch Curtis [Sun, 7 Sep 2014 16:12:00 +0000 (18:12 +0200)]
Improve Drag documentation.
Change-Id: Ifba60b729c8ad02009cd5c8caa5d58e20a76c73b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Mitch Curtis [Mon, 8 Sep 2014 09:11:50 +0000 (11:11 +0200)]
Fix broken QJSEngine snippet in documentation.
toBoolean() isn't even a function in that class, and declaring the
button on the stack causes crashes upon closing the application.
Change-Id: I063cac2bb144cfb9786f20bbc122d5af92a4c2c0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Richard Moe Gustavsen [Tue, 9 Sep 2014 08:27:47 +0000 (10:27 +0200)]
autotests: fix build on iOS
Change-Id: Idf854ad4f868e873582731dfa6b0253ac5b17c5c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Laszlo Agocs [Mon, 8 Sep 2014 08:14:43 +0000 (10:14 +0200)]
Enhance QQuickWidget docs regarding transparency
Provide a section similar to the one in the QOpenGLWidget docs.
Change-Id: Ibe161f5b6e1b6654e78b522f44ba21b89fc85abe
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Laszlo Agocs [Mon, 8 Sep 2014 13:23:02 +0000 (15:23 +0200)]
Tune the colors in the rendercontrol example
Change-Id: I904782e6a54c8df63a2e187cdfed5a3193ff2a54
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Laszlo Agocs [Tue, 9 Sep 2014 12:57:31 +0000 (14:57 +0200)]
Beautify the qquickviewcomparison example
Remove the red rectangle.
Change the background color to a gradient. (taken from rendercontrol)
Disable the transparency checkbox everywhere but Linux since it
usually will not work. (too much hassle with platform specifics like
frameless windows, etc.)
Change-Id: I21488386cddc5841a2bdc8104e7abb197b075b0d
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Erik Verbruggen [Fri, 22 Aug 2014 10:29:20 +0000 (12:29 +0200)]
V4 runtime: tune Runtime::add/sub/mul a bit.
Tell the compiler to schedule the int32 case first, tune the double
conversion a bit (int64->double is quite expensive), and write the
function in such a way that it matches typical overflow idiom which
compilers recognize.
Change-Id: Ieae9a60275716002fbdbc54e1d7291c8aad8c927
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Richard Moe Gustavsen [Thu, 4 Sep 2014 07:38:29 +0000 (09:38 +0200)]
QQuickTextInput: calculate height of cursor rect using QTextLine::height()
Calculating the height of the line using ascent + descent seems
inaccurate, since the result will not match what ends up being
drawn. QQuickTextEdit uses instead QTextLine::height() for the
same function, and this works correct.
Since there seems to be no reason to reinvent how to calculate the
height when the line already has a function for that, and since the
result also seems to be wrong, we change the implementation to
use QTextLine::height().
Change-Id: I9c9cd4360b6d4cfd3582756c4efdff9c02065789
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Ulf Hermann [Tue, 9 Sep 2014 14:25:54 +0000 (16:25 +0200)]
Don't post deleteLater on invalid canvas contexts
QCoreApplication complains about that. The context will only be valid
once it has been requested in one way or another.
Change-Id: Idb44f2541d71355443a5b491078a3040907b1614
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Eskil Abrahamsen Blomfeldt [Wed, 10 Sep 2014 10:03:28 +0000 (12:03 +0200)]
Disable tst_QQuickListView::programmaticFlickAtBounds()
This test gives false negatives blocking CI consistently.
Change-Id: Id904f147b720a183167f335ee4db856d7e3ca94d
Task-number: QTBUG-41228
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Eskil Abrahamsen Blomfeldt [Tue, 26 Aug 2014 08:52:22 +0000 (10:52 +0200)]
Fix pixel bleed in BorderImage
Keeping all patches of the border image in the same texture
with different sample points can cause parts of the border
to bleed over to the center patch. To rectify this, we
create a separate texture for each of the nine patches we
need, and separate image nodes.
To avoid applying antialiasing on the interior edges of the
border image, we introduce new antialiasing flags which can
be used to specify precisely which edges of the image should
be antialiased.
[ChangeLog][BorderImage] Fixed possible pixel bleed between
border patches and center patch in BorderImage.
Change-Id: Icc292b3969217320eecca99e79675316c42eab08
Task-number: QTBUG-35838
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Simon Hausmann [Mon, 8 Sep 2014 11:10:21 +0000 (13:10 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
.qmake.conf
src/qml/jsruntime/qv4arraydata.cpp
src/quick/scenegraph/util/qsgatlastexture.cpp
Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
Erik Verbruggen [Thu, 28 Aug 2014 11:12:53 +0000 (13:12 +0200)]
QML: parse .js files as JavaScript, not QML.
When importing a JS library into a QML file with the "import" keyword,
that JS file was parsed in QML mode, disallowing QML keywords like "as".
Task-number: QTBUG-40143
Change-Id: Ie98adceb27544732c2e96657d41170db36bff288
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Topi Reinio [Thu, 4 Sep 2014 12:49:06 +0000 (14:49 +0200)]
Doc: Fix link to Qt namespace
Linking to 'Qt Namespace' will link to the Detailed Description
section on the Qt namespace doc. Use the new linking format to
link to the start of the page instead.
Change-Id: Ib7e1b2b91fd9987262fc1a083ae94ef086260766
Reviewed-by: Martin Smith <martin.smith@digia.com>
Shawn Rutledge [Thu, 4 Sep 2014 10:53:14 +0000 (12:53 +0200)]
qmlscene: load master translation file before more specific ones
It was giving up too early because qmlscene_??.qm doesn't exist.
The file qt_??.qm links to all existing Qt-provided translation files,
so it is enough by itself unless there are application-specific
translations besides.
Change-Id: Iebedf54ddb4eef4f4d7da8a7fade1850a366aee8
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Richard Moe Gustavsen [Wed, 3 Sep 2014 12:55:59 +0000 (14:55 +0200)]
QQuickTextInput: keep floating point precition when calculating offset
Without this patch, positionToRectangle will return a slightly
different rectangle than what ends up being drawn.
Change-Id: Ib1a3936f0fab393d6016d85d63547ec7f3036b7a
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Olivier Goffart [Wed, 3 Sep 2014 18:42:04 +0000 (20:42 +0200)]
MouseArea: Fix cancelling the double click when the windows loses focus
Without this, the next click is not received after the windows loses
focus while we double clicked but not released the mouse.
This may happen if the onDoubleClicked opens a new window
Change-Id: I86742de2bb1ea4c9657b9d5e90472d093293177d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Gunnar Sletta [Tue, 2 Sep 2014 09:49:50 +0000 (11:49 +0200)]
Fix performance regression caused by SG signals in QQuickItem.
For a testcase with thosands of items, I measured an increase
in shutdown time from 800ms to 7500ms, all spent in disconnect().
This is not acceptible, so we're choosing a different approach.
If items implement a invalidateSceneGraph slot, this function
will be called during shutdown. It should be made a proper virtual
in Qt 6. This approach costs very little.
Change-Id: I5970143cc0a0744955687e17586f0bb00c9afb26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Andy Nichols [Tue, 2 Sep 2014 11:58:26 +0000 (13:58 +0200)]
Append scenegraph in MODULE_PLUGIN_TYPES of quick module
While scenegraph is already a plugin type, it was not defined
as plugin_type by the module feature file so qmake fails to build
when using load(qt_plugin).
Change-Id: I7a6cf21358bbda9878ebe78b7c208c0ded2cf4a9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Eskil Abrahamsen Blomfeldt [Mon, 25 Aug 2014 10:46:11 +0000 (12:46 +0200)]
Fix selection of text with negative right bearing
Selecting text with a negative right bearing (like italic text)
would cause clipping to occur at the edges of the characters.
The algorithm for drawing text and text selection tried to
divide the text into two: 1. Selected text, and 2. Unselected text.
However, the selected text might be drawn outside the selection
rect when it has a negative right bearing. Similarly, unselected
text before the selection might overlap with the selection rect
when it has a negative right bearing, or unselected text after
the selection might overlap if it has a negative left bearing.
See added test textinput_italic_selected.qml for an example.
To rectify this, we do drawing of selected text like this:
1. Draw all text with unselected color
2. Draw selection rects
3. Draw the following in the selection text color and clipped
to the selection rect:
A. The selected text
B. The unselected text right before the selection
C. The unselected text right after the selection
To avoid drawing the same text twice for extra boldness,
we check if 3B or 3C actually contain 3A, in which case we skip
3A.
[ChangeLog][Text] Fixed clipping when selecting text with negative
right bearing.
Task-number: QTBUG-34233
Change-Id: I3506b3a72a2d963c5f24c5b819bbb92769b9aee1
Reviewed-by: Samuel Nevala <samuel.nevala@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Andy Nichols [Mon, 1 Sep 2014 10:45:10 +0000 (12:45 +0200)]
Remove Q_ASSERT when getting the OpenGL Context Profile
We do not actually use the OpenGL context in this method other than to
query the profile type if one is available. In the case that there is
no context the profile type does not matter and the default value of
QSurfaceFormat::NoProfile is correct.
Change-Id: Ice4440fe0e578d4cdcba347f5325768667722af8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Kai Koehne [Mon, 1 Sep 2014 08:43:01 +0000 (10:43 +0200)]
Remove use of anonymous struct in header file
Although all compilers seem to support this, anonymous structs have only
been added formally to C++ 11. Also, this breaks with a change that adds
a constructor to QElapsedTimer:
error: member 'QElapsedTimer QQmlInstantiationInterrupt::<anonymous struct>::timer' with constructor not allowed in anonymous aggregate
QElapsedTimer timer;
^
Change-Id: I5672060e3a623a5d9c4eb1d4e2981c67b96a1192
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 12 Jun 2014 12:35:53 +0000 (14:35 +0200)]
Fix crashes when calling Array.sort with imperfect sort functions
We can't use std::sort to implement Array.sort. The reason is that
std::sort expects a conformant compare function, and can do weird
things (esp. crash) when the sort function isn't conformant.
Falling back to qSort is not possible, as the method has been
deprecated. So add a copy of the qSort implementation here, and
use that one instead.
Fix the sortint test in tst_qqmlecmascript to have a consistent
sort function for strings, as the result of calling sort is
otherwise undefined according to the ecma standard.
Task-number: QTBUG-39072
Change-Id: I0602b3aa1ffa4de5006da58396f166805cf4a5e2
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Eskil Abrahamsen Blomfeldt [Fri, 29 Aug 2014 13:40:52 +0000 (15:40 +0200)]
Support padding in images stored in atlas texture
If the stride does not match the width of the image, we upload
it line-by-line instead of as one big rect.
Change-Id: I5e08afcf5c35dc810fed25e45255d55d932b2a4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Gunnar Sletta [Thu, 28 Aug 2014 09:27:02 +0000 (11:27 +0200)]
Fix crash with cleanup of animators.
We had several separate issues relating to how the jobs were cleaned up.
The first was that upon getting setWindow(0), the animator did not
reset m_controller to 0, leading to the starts() coming after that to
post null jobs to the controller. This would later crash in
beforeNodeSync as the starting job was null.
The second issue was that during shutdown, QQuickAnimatorProxy
would try to delete jobs on the controller which was already
deleted. The controller is deleted on the GUI thread regardless
of render loop, so this was solved with a QPointer.
The third was that we were a bit too aggressive in trying to clean up
jobs on the GUI thread, so we introduced a new bool which gets set to
true in startJob() so that Proxy::deleteJob() knows who owns the job.
Task-number: QTBUG-37833
Change-Id: I1b6221a2c1ce2bfd0758801b950cda00ff6899d0
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Laszlo Agocs [Thu, 28 Aug 2014 15:18:46 +0000 (17:18 +0200)]
Fix the dynamic build by not calling glGet directly
Change-Id: I97ee290c31ca4fa0ffc2f822f14bc7d5e34dd222
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Laszlo Agocs [Thu, 28 Aug 2014 10:23:46 +0000 (12:23 +0200)]
QQuickWidget: Keep the offscreen quick window size in sync
The resizing logic has some faults: The size change is not always communicated
to the offscreen QQuickWindow. When hiding and showing a QQuickWidget we may
return early from the resize event handler, skipping the geometry change for
the offscreen window. This is wrong.
To make sure the sizes always match, set the geometry together with the
FBO creation instead. This is much more robust and guarantees that the
FBO size and the QQuickWindow size will not be out of sync.
Task-number: QTBUG-40517
Change-Id: I61ef3ad2d23dff4280dbf03b57c03c1aeda8dc91
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Simo Fält [Fri, 29 Aug 2014 09:21:38 +0000 (12:21 +0300)]
tst_qquickcanvasitem: Setting as insignificant.
Task-number: QTBUG-41043
Change-Id: Ib438ddc890e9a1ede16731b950b195d4341b8fd0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Tim Jenssen [Fri, 29 Aug 2014 11:09:53 +0000 (13:09 +0200)]
introduce *.ui.qml file types as new forms file type
Change-Id: I1f07b6c1ab8afac7ee7ad05e988fe313ba904705
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Gunnar Sletta [Fri, 29 Aug 2014 09:55:32 +0000 (09:55 +0000)]
Abort the application if the render thread fails to start
This is a system-level failure, with which we can do very little,
so we abort.
Change-Id: I945da8bd28df35a6c8987160a2f0177d27d6c95d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Frederik Gladhorn [Fri, 29 Aug 2014 09:33:28 +0000 (11:33 +0200)]
Bump version
Change-Id: I54ace3320d63c54119084b27eb2c1797166f0b37
Frederik Gladhorn [Thu, 28 Aug 2014 21:11:05 +0000 (23:11 +0200)]
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Tim Jenssen [Thu, 28 Aug 2014 14:51:00 +0000 (16:51 +0200)]
Add new property "designersupported" to qmldir
This patch adds a property called "designersupported" to qmldir.
This allows the Qt Quick Designer to only load plugins that
have the line ""designersupported"" in their qmldir file.
So the designer can load sub components without risking to load
plugins that have never been tested in the designer and that might crash.
The check for "designersupported"" is activated by using
QQmlImports::setDesignerSupportRequired().
Change-Id: I4bf07cc163faa47996eacb1365a7961c51c51060
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Frederik Gladhorn [Thu, 28 Aug 2014 14:18:27 +0000 (16:18 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: I92b91cce499ed4bec64521a581276f397792e218
Mitch Curtis [Wed, 27 Aug 2014 10:35:47 +0000 (12:35 +0200)]
TestCase.qml: add missing closing parenthesis to example.
Change-Id: I93f1f8ec74808fc0a9f681cd88f7e5616089c80c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Laszlo Agocs [Tue, 26 Aug 2014 14:13:27 +0000 (16:13 +0200)]
Fix not having a context when making a QQuickWidget visible again
If we hit the size-is-zero path, the condition that got recently introduced
(if fakeHidden && d->context) is not really sufficient. It could be that
d->context is valid but the scenegraph is invalidated (i.e.
offscreenWindow->openglContext() is null).
This case has to be handled the same way.
Therefore, the function is now simplified to perform polish & sync
in one place.
Task-number: QTBUG-40794
Change-Id: Ia54f25fbdc199a0b88501a2d89edb5cee5411972
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Gunnar Sletta [Wed, 27 Aug 2014 05:35:24 +0000 (07:35 +0200)]
Make minimum FBO size 1x1 on newer OSX.
This problem existed on 10.6, but is not reproducible on newer
MacBookPros, so disable it for 10.8 and up.
Change-Id: I0ae216c8e2307df5f77a783ec2d2031bf12ccbf2
Task-number: QTBUG-20193
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Kai Koehne [Tue, 26 Aug 2014 10:15:31 +0000 (12:15 +0200)]
Use QtQuick.Window 2.2
Use version 2.2 in the documentation and for the .qmltypes file.
The revision for properties got dropped in commit
7ceca6ac0 , and
is now dropped from the .qmltypes file, too. The removed signals
are also dropped because of that (because they are implicitly
declared by the property, anyway).
Change-Id: Ia14dd403ce1f098cb378bd7940e8f80f32b770a0
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Andy Nichols [Tue, 19 Aug 2014 14:08:23 +0000 (16:08 +0200)]
Added QSGPainterNode abstraction to QSGAdaptationLayer
This allows the scenegraph backend to customize how QSGPainterNodes are
rendered.
Change-Id: I640dcf121d0be6bda615cf30591d502329fc89d0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Erik Verbruggen [Tue, 26 Aug 2014 12:21:01 +0000 (14:21 +0200)]
V4 JIT: fix stack layout.
Commit
d9f33ccdef985badc56fd8940373748626beffc7 introduced an off-by-one
in the calculation of the offset of a saved register (in
StackLayout::savedRegPointer), resulting in overwriting a callee saved
register with the tag of a QV4::Value. This method now calculates those
pointers relative to the bottom of the stack frame.
The off-by-one didn't happen before that patch, because there was a
magical +1 used in the constructor for the number of callee saved
registers, thereby prevented this from happening. However, that resulted
in a frame size that was unnecessary big.
Task-number: QTBUG-40927
Change-Id: If88fe9f3490a4d23a1e69c630c87219fcfef671f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Fri, 22 Aug 2014 10:11:40 +0000 (12:11 +0200)]
V4: disable type inference and loop peeling for the interpreter.
Loop peeling is always disabled. Type inference is still enabled for
QML code, because of the static-type nature of the properties.
This speeds up crypto.js by 20%.
Change-Id: Ibf51cb36f8904d64df0793980d463451dfd361e2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Mon, 25 Aug 2014 09:06:58 +0000 (11:06 +0200)]
Fix cursor blinking for TextInput and TextEdit
Before commit
fb339b21b8a24b835cea7a057c47b7c5ad80dd72 relied on the simple
transparent rectangle node to remain invisible. After that commit we used the
regular rectangle node, which doesn't seem to like toggling the color between
transparent and solid black and therefore the cursor was always visible.
As advised by Gunnar this patch implements a much simpler logic: When the
cursor is supposed to be invisible, we just don't create a scene graph node for
it anymore.
Change-Id: I7b0e173f6d37997559ee0911f37903efdb14847f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Gunnar Sletta [Sat, 23 Aug 2014 07:00:51 +0000 (09:00 +0200)]
Make QQuickFramebufferObject a texture provider.
Change-Id: Ib9cf0f99dc07e4125c4ccd2d45da2839d8af88b6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Laszlo Agocs [Fri, 22 Aug 2014 17:31:13 +0000 (19:31 +0200)]
Fix up vao usage in qquickviewcomparison example
The binder calls create() if needed, so drop that call.
In the render function however, drop the binder.
Trying to create() again and again on every frame is a
waste of time.
Change-Id: I1e9cd8e2c97030b96e604256661e65ce75446e9d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Laszlo Agocs [Tue, 26 Aug 2014 08:28:53 +0000 (10:28 +0200)]
Do not send deferred deletes from the QQuickWindow dtor
Otherwise doing deleteLater() on an ancestor of the QQuickWindow will
cause double deletion for that ancestor. This is typical when using
WA_DeleteOnClose since that uses deleteLater().
Task-number: QTBUG-40920
Change-Id: I9146fc0854f77c42cad2eda23b3cdaa7a9e22080
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Simon Hausmann [Tue, 26 Aug 2014 07:51:49 +0000 (09:51 +0200)]
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Venu [Thu, 21 Aug 2014 12:52:49 +0000 (14:52 +0200)]
Doc: Added a link to the QML advanced tutorial
This avoids the need to duplicate the example details
that are already covered in the tutorial.
Task-number: QTBUG-37203
Change-Id: If7e762dc1d9a572b83bddffe7982aec9a6363408
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Simon Hausmann [Tue, 26 Aug 2014 07:43:33 +0000 (09:43 +0200)]
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
src/qml/qml/qqmlobjectcreator_p.h
Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
Gunnar Sletta [Sat, 23 Aug 2014 13:27:51 +0000 (15:27 +0200)]
Make QQuickPaintedItem a texture provider.
Change-Id: I605dc35fcc2284a890851c41946cf95537e92d2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Sat, 23 Aug 2014 12:24:05 +0000 (14:24 +0200)]
Make use of QQuickWindowQObjectCleanup in QQuickImage.
Saves us a few lines..
Change-Id: I572f6fc44ede3b923208ce3563116d8fcc9bb922
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Sat, 23 Aug 2014 12:13:53 +0000 (14:13 +0200)]
Make Canvas a texture provider.
Change-Id: I8b5c9d8a5ed9ef9079eafb30ef0cb73786204ee6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Fri, 22 Aug 2014 14:52:05 +0000 (16:52 +0200)]
Added an example that shows how to consume texture providers from C++.
And how to use use two textures in the same material.
Change-Id: Idcc618ed359422c2a104eeed105b7c4f5086ee4e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Fri, 22 Aug 2014 06:59:15 +0000 (08:59 +0200)]
Clamp QQuickItem::opacity to [0,1].
This was an oversight the the implementation of
setOpacity. QSGOpacityNode already does the right thing.
[ChangeLog][QtQuick][Item] When Item.opacity is set to a value outside
the range of 0 to 1, it will be clamped.
Change-Id: Ib7f23c5d8860c76e009a25e5ab2c36db20301faf
Reviewed-by: Raine Mäkeläinen <raine.makelainen@gmail.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Lars Knoll [Thu, 12 Jun 2014 08:11:09 +0000 (10:11 +0200)]
Don't use d->instanceModel after free'ing it
prevModel points to d->instanceModel and is being
used further down in the code. So reset the pointer
to 0 after freeing the old instanceModel.
Change-Id: I8854ae3e09c8b2fe50ad311f3dbc7b8ed26805e1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Tasuku Suzuki [Sat, 16 Aug 2014 13:15:32 +0000 (22:15 +0900)]
Mark custom node in textureinthread dirty after rendering texture
Change-Id: I4401a6db18b1fcc69403062f3f4775d3b62dfd3e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Pelle Johnsen [Wed, 20 Aug 2014 10:06:10 +0000 (12:06 +0200)]
Fix QML2 hang on gcc 4.6.3 armhf
With gcc 4.6.3 armhf (defualt for Ubuntu 12.04) some optimization bug
results in QML2 v4 compiler hang during type inference.
Task-number: QTBUG-40364
Change-Id: Iea1a8be3b5a7d9410304110d89dae3735339cb72
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Sebastian Sauer [Tue, 12 Aug 2014 11:53:00 +0000 (18:53 +0700)]
QSM: Reintroduce guard argument evaluation
Implements the suggestion from Simon Hausmann (codereview 89716
from 08-05 14:46) to use QQmlScriptString rather then the previous
used MetaObject-manipulation.
This also introduces comparison operators for QQmlScriptString
to be able to determinate if a QQmlScriptString changed what
is needed cause there is otherwise no way to access (all) the
needed details within QQmlScriptStringPrivate.
Change-Id: I198479eac8fd37cbdd98a99aacdd8eebf7b75d21
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Thu, 21 Aug 2014 11:10:33 +0000 (13:10 +0200)]
Fix crash with early QObject property access
In the reported bug, it can happen that we try to access the compile-time resolved
QObject property of an object that is referenced by id. The binding that uses this is
triggered when the property changes but _also_ when the id referenced object gets either
created or deleted. The first time the binding is evaluated is very early on, when the
id referenced object is not created yet, so the binding evaluation fails. However the
dependency is set up, and so later then the id referenced object is created and the id
property is set on the context, the notification triggers and the binding is re-evaluated.
During that binding evaluation a QObject property access happens by index on an object that
doesn't have its VME meta-object set up yet. Therefore the property access fails and a
crash occurs or the Q_ASSERT(property) assertion fails.
The fix is to set register the id named object in the context _after_ the VME meta-object is
setup.
Task-number: QTBUG-40018
Change-Id: Ic2d7b4a0c49635efe68e93f2f6c316eb65f0c309
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Albert Astals Cid [Thu, 21 Aug 2014 13:39:56 +0000 (15:39 +0200)]
Fix typo in DelegateModelGroup documentation
Change-Id: Ic01f0935c469f85f32699aebaeb1fc6f8b2279fb
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Mitch Curtis [Fri, 22 Aug 2014 07:52:59 +0000 (09:52 +0200)]
Remove references transforms have to items in QQuickItem's destructor.
In case they try to remove themselves from our list of transforms when
that list has already been destroyed after ~QQuickItem() has run.
Task-number: QTBUG-40877
Change-Id: Ie57f5dd1e8b791846f08629183974c771553c4bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Lars Knoll [Mon, 18 Aug 2014 10:38:24 +0000 (12:38 +0200)]
Protect some members in QQmlObjectCreator
Avoid dangling pointers when nested incubators are being used.
Task-number: QTBUG-40437
Change-Id: I73922d2f373b2efbc00983305cdea9e8d60f0c41
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Jani Heikkinen [Fri, 22 Aug 2014 06:13:59 +0000 (09:13 +0300)]
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>
Lars Knoll [Thu, 12 Jun 2014 08:19:12 +0000 (10:19 +0200)]
Initialize variable
Change-Id: Ia54dc43d22b8edaa49634c6a364f87b4a06d659d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 12 Jun 2014 08:52:32 +0000 (10:52 +0200)]
Don't abuse new to do a reinterpret_cast
Using new to do a reinterpret_cast is rather confusing.
Also protect the list model case against self-assignment
which could lead to memory corruption.
Change-Id: I10b81644d0004d4a50a5a74e5b8c58e27cbe6934
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Albert Astals Cid [Thu, 21 Aug 2014 13:36:30 +0000 (15:36 +0200)]
Add const & to arguments
Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Gunnar Sletta [Fri, 15 Aug 2014 12:15:14 +0000 (14:15 +0200)]
Mark QQuickFBO's node dirty after rendering the texture.
It is impossible to use in a shader effect otherwise.
Change-Id: I489e6ae43cdc3fe8f54efa6d86ead4d21831b84d
Task-number: QTBUG-40809
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Sat, 23 Aug 2014 12:13:05 +0000 (14:13 +0200)]
Introduce QQuickWindowQObjectCleanupJob.
Convenience for cleaning up texture providers. Private class for now,
we can maybe make it public in 5.5.
Change-Id: I3489fde2a268bc988634a16f87ee558b9ac5dba2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Simon Hausmann [Wed, 13 Aug 2014 08:17:53 +0000 (10:17 +0200)]
Improve the internal NodeVisitorEx API
Allow the implementation of visit to control whether the children should be
processed afterwards or not. This is modelled after the JS AST visitor in
Qml.
Change-Id: I5b1adf5e1aefd8899bf444e993ddfbf2c5c125c9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Gunnar Sletta [Fri, 15 Aug 2014 07:26:16 +0000 (09:26 +0200)]
Downscale textures which exceed the GL texture limit
This way they will at least render.
[ChangeLog][QtQuick] Images exceeding GL_MAX_TEXTURE_SIZE will be
downscaled to fit so they will still show.
Change-Id: I169ecac768036812b8e14265ec1a0a8902655666
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Thu, 21 Aug 2014 09:59:03 +0000 (11:59 +0200)]
Protect incubation against its creator being deleted.
Change-Id: Ica7ed02c9b67243310ddce3feaf91935b699086d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Mon, 11 Aug 2014 11:21:11 +0000 (13:21 +0200)]
Cleanup: Separate the sub-tree layering out of QtQuick into the scene graph
This basically renames QQuickShaderEffectTexture to QSGDefaultLayer and
introduces QSGLayer as interface to be used. QQuickShaderEffectTexture is
generic for the scene graph and has no QtQuick dependencies. The interface
separation allows scene graph backends to customize layers.
Change-Id: I9a7f37addaa4b80a34ff9a1456b0cb9b16d4e9f3
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Gatis Paeglis [Tue, 12 Aug 2014 12:46:05 +0000 (14:46 +0200)]
Introspect qrc files in FolderListModel.
And don't use "file watchers" for resource file paths,
otherwise it generates the following warning:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No
such file or directory
Change-Id: I6b75c9195fb2b2ba7b3e0bb7d146fc5cd343927e
Task-number: QTBUG-40307
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Laszlo Agocs [Wed, 20 Aug 2014 14:52:38 +0000 (16:52 +0200)]
Avoid creating fbo with zero size in QQuickWidget
Get rid of incomplete attachment warnings on Android.
Change-Id: I7da546861b1814677b0c8ae110416f69bbbb7edc
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Alan Alpert [Wed, 20 Aug 2014 18:02:54 +0000 (11:02 -0700)]
Add 5.3.2 changelog for qtdeclarative
Change-Id: I33e8149ec9e2f7ecfebb7f55de0dbb291805be93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Tue, 24 Jun 2014 08:35:42 +0000 (10:35 +0200)]
Fix crash with recursively loading cached compilation units
When a cached compilation unit depends on an import that is implemented as a
Qml C++ plugin and that plugin in turn loads an asynchronous component that is
cached, we would get a crash in the typeloader and a failing assertion
(ASSERT: "d->m_mainThreadWaiting == false" in file qml/ftw/qqmlthread.cpp, line 300)
This is because we did not implement the asynchronous loading within the loader
thread for cached compilation units. This is simply done using a posted event,
using the same mechanism used for other async load methods.
Change-Id: Iefce67ab634ce26122c348dcdfc8e66b00fec671
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 8 Aug 2014 14:33:58 +0000 (16:33 +0200)]
Cleanup: Remove ShaderEffectSourceNode
We can simply use a standard image node and do the dirty marking also
directly in the texture (both live in the same thread).
Change-Id: I7345c702613782adec3c6a36a7705a2a54ed82ec
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Sebastian Sauer [Tue, 12 Aug 2014 11:52:50 +0000 (18:52 +0700)]
v4: Enable primitive conversation to QQmlScriptString in javascript
This makes following QML-code proper working:
ParentChange {
x: 0
Component.onCompleted: x = 10
}
where x is a QQmlScriptString.
Before this patch an error-message would be thrown that the
bool/int/string/etc cannot be converted to a QQmlScriptString.
With the patch primitive types including null and undefined are
proper converted to a QQmlScriptString. The patch ignores (as
in not implements) function/binding assignment.
Unfortunately since commit
aa25ad8d5f4 its not possible any
longer to instanciate QQmlScriptString what means there is
otherwise no (easy) way to inject a QQmlScriptString from
within Javascript.
Change-Id: I18aac6a6e9a57f3b7d0a2d66cdab2be6c3c153c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Gunnar Sletta [Mon, 18 Aug 2014 07:31:08 +0000 (09:31 +0200)]
Fix memory corruption in shader materials.
Change
ee616b3905106a3eedef9ee964ab283ef45c7dbc accidentally
removed the member variable used to refcount the attribute
names. This resulted in the names being deleted and the
stored const char *'s to become invalid. Add it back.
Change-Id: Ie33f75cd76085283a5ee685602e023bb3c42c896
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Mitch Curtis [Mon, 18 Aug 2014 16:30:35 +0000 (18:30 +0200)]
Fix typo in StateChangeScript documentation.
Change-Id: Iec72331c183ea02680bad01f04eae82ebd815cdb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Erik Verbruggen [Wed, 23 Jul 2014 10:22:11 +0000 (12:22 +0200)]
V4 IR: Add loop peeling.
By peeling the first iteration off of a loop and putting it in front of
the loop, type inference can deduce more type information for esp. loop
induction variables. To prevent increasing the code size too much, only
the inner-most loops are peeled.
This gives a 10% speed-up on crypto.js.
Change-Id: I57f9611695bc8defc0bff84e440b8a20b2c8a34e
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Erik Verbruggen [Wed, 23 Jul 2014 10:17:28 +0000 (12:17 +0200)]
V4 IR: add immediate dominator re-calculation.
When removing edges, the control-flow graph changes, so some immediate
dominators might need to be updated. This change collects all candidates
and processes them in a single batch.
Change-Id: I928f42232427a84bcb9658e314dadd0bd021b12f
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Topi Reinio [Fri, 15 Aug 2014 11:10:55 +0000 (13:10 +0200)]
Doc: Removing url variable from qdocconf file.
-url inherited from the url variable set in qtbase/doc/global
Change-Id: I94a0da7aa98af1fdd6140168fe9feb27b11c0bdb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Alex Montgomery [Fri, 15 Aug 2014 16:41:56 +0000 (09:41 -0700)]
Fix setContextObject to re-evaluate bindings
Fix QQmlContext::setContextObject to reevaluate bindings as the
documentation says that it should.
Task-number: QTBUG-40798
Change-Id: Ifbd97c7a07a5432f4948937da863370b05705206
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Laszlo Agocs [Thu, 14 Aug 2014 11:34:30 +0000 (13:34 +0200)]
Fix cursorShape with QQuickWidget
Task-number: QTBUG-40729
Change-Id: If3b2f8ca8795da1ac7c626db9c872f735d1e7b5d
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Venu [Wed, 13 Aug 2014 14:26:32 +0000 (16:26 +0200)]
Added the QtSQL dependency info. to the project file
Without this information the app fails to find the plugin
required to load the QtQuick.LocalStorage module on Android.
Task-number: QTBUG-37203
Change-Id: I245012e78ab8d1fe3205e08939f4baec58c20759
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Simon Hausmann [Wed, 6 Aug 2014 12:59:34 +0000 (14:59 +0200)]
Cleanup
Merge QV4::CompiledData::QmlUnit into QV4::CompiledData::Unit. For pure JS
units it means a slight increase of memory usage by a few bytes, but overall it
makes the code a lot simpler.
Change-Id: Ib48927749720b056f004aac0fe22cb8ec729e3f6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Robin Burchell [Mon, 11 Aug 2014 09:23:42 +0000 (11:23 +0200)]
tst_dialogs: verify that rootObject is valid
if there's an error during loading, it's much easier to spot if this fails
rather than crashes.
Change-Id: If0106729e18768819da8a877959a095398af8547
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Robin Burchell [Mon, 11 Aug 2014 09:23:47 +0000 (11:23 +0200)]
tst_dialogs: QTRY_ on the expression (spyVisibilityChanged.count) not the variable.
We only assign to the variable once, so the value may not change in time.
Change-Id: I54ac7faad60d3984bfde4606aaf7e30a2340ba3e
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Gunnar Sletta [Thu, 14 Aug 2014 11:53:11 +0000 (13:53 +0200)]
The cached objects can be deleted, so keep them in a QPointer.
Change-Id: Ieaebd2e7b9823cbe22efc331e42ceab8fbbda0e8
Task-number: QTBUG-40201
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Laszlo Agocs [Thu, 14 Aug 2014 10:58:55 +0000 (12:58 +0200)]
Fix flicker when showing QQuickWidget
This also reintroduces the change from commit
14b4747b17d522fe57f3a5f21738c5a89323b5e2.
Due to some bizarre merge issue that change has disappeared from qquickwidget.cpp
and its history. It is there in the main log, though.
The new fix depends on this older one, so the combined one fixes the following
three issues:
1. Polish and sync cannot be skipped when we are rendering for the first time.
2. Recreating the fbo twice when the widget is shown. Calling
createFramebufferObject() is not necessary in this case since createContext()
will trigger this anyhow due to scenegraphInitialized().
3. Avoid recreating the fbo when the size is the same as before. Some platforms
are keen on sending resize events with the same size. These should be ignored.
What's worse, some platforms (cocoa) generate a resize on exitting (Cmd-Q)
and not ignoring the resize at that stage is dangerous since the scenegraph
is already invalidated.
Task-number: QTBUG-40710
Task-number: QTBUG-40505
Change-Id: I2e897acc68fa68233563a1db63ffb6c5d0baad73
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Erik Verbruggen [Thu, 14 Aug 2014 08:56:54 +0000 (10:56 +0200)]
V4 JIT: fix int32 to double conversion code
Missing else: two (nearly identical) conversions would get generated.
Change-Id: I745120f81d42bf28fbce7ab6a62da909a8e14458
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Fri, 8 Aug 2014 13:36:37 +0000 (15:36 +0200)]
V4 JIT: add d8-d15 as available FP registers on ARM.
VFP3-d16 is the minimum implementation available on ARMv7, so these
registers are also always available. The big added bonus is that they
are callee saved, so using them will result in less loads/stores for
doubles.
Change-Id: I0cab3fe24d8677315b4c7d9449d8619cbf9a2919
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>