Commit Graph

17751 Commits

Author SHA1 Message Date
Ulf Hermann fc820ca494 qmllint: Fail on recursion depth errors
Change-Id: I815f82ed8c005ed83ceecff6ce80106a9ad9b21d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-08-19 09:58:31 +02:00
Laszlo Agocs 7629c8de57 Add an initial set of scenegraph docs for the rhi
Just the basics for now. Start moving away of the assumption
of default backend = direct OpenGL, but limit the amount of
RHI-specific details for now. This should be sufficient
for the first preview in 5.14.

Change-Id: I94e80d5fbed1269f7e8911284c28ac5fbc858be7
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-17 16:26:31 +02:00
Laszlo Agocs 46ed976097 Rescale on rhi path too when NPoT textures not supported
QRhi will not do this for us. Also handle mipmap filtering correctly
in this regard.

This will fix rendering on WebAssembly.

Change-Id: I93a77b7c42bb43c59dfb7748f9fdbd7aa55f39bb
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-17 16:26:20 +02:00
Alexandru Croitor 527687a866 CMake: Provide API to allow handling of QML static plugins
This change adds a new -cmake-output command line argument to
qmlimportscanner which outputs its result in a format which is
consumable by CMake.

This change also adds a new CMake package called Qt5QmlImportScanner.
It provides a function called QT5_IMPORT_QML_PLUGINS()
which is useful for projects that use a static build of Qt and which
also use QML plugins.

Calling it with the target name of your application does the
following:
- Runs qmlimportscanner at configure time to find out which QML /
QtQuick plugins are used by your project
- Links the imported QML plugins into the target
- Links the static dependencies of the QML plugins into the target
- Generates a .cpp file that initializes imported QML plugins,
which is subsequently compiled and linked into the given target

When Qt is built in a shared library config, the introduced function
is a no-op.

[ChangeLog][CMake] Added ability to import static qml plugins with
CMake builds using the new QT5_IMPORT_QML_PLUGINS function.

Task-number: QTBUG-38913
Change-Id: Ib9b9a69654eab13dfbe12d10f5cb28ba3c307d1b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-17 12:03:45 +02:00
Marc Mutz 412be2096c QSGDepthStencilBufferManager: don't use toStrongRef().data()
It's an anti-pattern.

Even though we don't expect other threads to destroy the last QSP
while we use the pointer obtained from QWeakPointer, play it safe
and use QWeakPointer idiomatically: as a non-owning reference, to
be converted to an owning one for the duration of our use of the
payload object.

Add an assertion that explains why we don't expect expired weak_ptrs
here.

Amends 0f035c0ad7.

Change-Id: Ia39ef5fa243e0e73110aae13da35f4f2ada73a73
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-08-17 08:15:34 +02:00
Ulf Hermann efe0bec946 Allow Connections to handle signals using JavaScript functions
Requiring full function definitions as signal handlers has two
advantages:

1, We don't need a custom parser that magically recognizes properties
   which would otherwise be an error in other components.
2, The user is forced to specify the full signature of the handler,
   including any parameters. This helps when the functions will
   eventually be compiled to C++

The old behavior is retained, generating a warning if any of the magic
bindings are still set in a Connections element. Only if no magic
bindings are found, the functions are connected. This is because there
might be functions named onFoo in old-style Connections elements and
silently connecting those to any matching signals would be a change in
behavior.

Change-Id: I8c78d8994fdcddd355fe822cde9a0702dc8c75de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-16 09:16:38 +02:00
Laszlo Agocs 88534c9537 Enable threaded render loop for d3d11
Change-Id: I5772b38c59b8fe3f9a30f56d3a559f6161443562
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-14 15:59:28 +02:00
Laszlo Agocs b70fcaa7ce Minor cleanup and logic fix in basic renderloop
The (gl) condition is clearly an oversight, the branch should be taken
if either gl or rhi are valid.

Change-Id: Ieb0a9aeec996f8940716f9fdafe90525b60fc248
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-14 13:59:14 +00:00
Jan Arve Sæther f18fefc3ba Fix qquickfolderlistmodel autotest on Android
Mostly resource path issues. It also seems to be some issues with the
default folder of FolderListModel on Android.

Change-Id: I8260775afd53bfe33977a9571d37009703774ae8
Task-number: QTBUG-77335
Task-number: QTBUG-73512
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-08-14 11:39:12 +02:00
Jan Arve Sæther 07ea03a8a2 Fix qqmlsqldatabase autotest for android
Change-Id: Ide59a86edbef87ccde83160c50f3e27dbc06e890
Task-number: QTBUG-73512
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-14 10:44:50 +02:00
Jan Arve Sæther e9bd94065d Fix qqmlvaluetypes autotest for android
The test assumed that QFont::pixelSize always retured -1.
QFont::pointSizeF might also be -1.

Change-Id: Ia00ecdd897fc15de533bdfb34716d568c5c4c6c2
Task-number: QTBUG-73512
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-14 10:44:26 +02:00
Jan Arve Sæther 1ec1a86347 Fix qqmllanguage autotest on Android
Mostly fixes to the usual resource paths.

In addition, we now put the special file with UTF-8
I18nType?????.qml typename in a resource file on Android, which actually
works.

Task-number: QTBUG-73512
Change-Id: I1835b5d358c14fbb3f6dfc954de03594f7fed621
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-14 10:43:55 +02:00
Jan Arve Sæther 4520862e9d Fix qqmlpropertymap autotest for android
Change-Id: I1734efcc2e7aa06185d1f713ecee63da9a7fc320
Task-number: QTBUG-73512
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-14 10:43:32 +02:00
Jan Arve Sæther 3e86e35ad4 Fix qqmltimer autotest for android
Change-Id: I15967c6895e1a0c03d8aa279c2e78dc3f5318f01
Task-number: QTBUG-73512
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-14 08:43:18 +00:00
Volker Hilsheimer d3e23c5125 Adapt usage of QMetaCallEvent to changes in QtCore
Memory allocation is now handled by QMetaCallEvent.

Change-Id: I78a2145af6cf93de5e9d71d6b943841f67183fa8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-13 19:25:29 +02:00
Jan Arve Sæther a9dad706a4 Fix qqmlxmlhttprequest autotest for android
TestHTTPServer needs to convert QUrl to QStrings while also keeping
the resource information. (QUrl::toLocalFile() only converts to a local
file.)

Change-Id: I548a83f4db190efc89251a8335a52595829c5887
Task-number: QTBUG-73512
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-13 11:38:14 +02:00
Jan Arve Sæther f7156b7de9 Skip perfMapFile test on Android
qmljs is not available on Android, so we skip the test

Change-Id: I93655fcbcaa405edf35846a93ef1467d651a62d7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-13 11:37:59 +02:00
Mikko Gronoff bc30f5e23f scenegraph: fix error: 'QOffscreenSurface' does not name a type
Change-Id: I41a8b30b316b038ed1e3910adb0254931f385a2a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-08-13 09:11:56 +03:00
Fabian Kosmale bef4800768 Blacklist tst_qquicktextedit::mouseSelection in openSuse leap
This autotest is blacklisted as it is deemed flaky.

Task-number: QTBUG-77389
Change-Id: I3561c98f0248507755f99fd7b6fe24c3d24cb522
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-08-12 11:15:53 +00:00
Shawn Rutledge d4e1f5395c Use QSH::mouseDoubleClickDistance() and touchDoubleTapDistance()
... in documentation links and in implementation, now that they have
been added. The doc links to QPlatformTheme::MouseDoubleClickDistance
and QPlatformTheme::TouchDoubleTapDistance were dead ends because
of those being private; and user code needed a way to read the values.
So now there is new API in QStyleHints.

Fixes: QTBUG-76944
Change-Id: I86bce4c7fe08c9da33745a4eed450757b3a30b03
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-08-12 07:56:15 +00:00
Yulong Bai d1b72c98b4 Fix unused captured 'this' warning
Change-Id: I90ddcfe42cae7364d321bd1c3a05eaba416081d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-07 18:13:12 +02:00
Yulong Bai fc680af663 Fix undeclared 'memcpy' identifier
Change-Id: Ie2290a1734370ff09e499809b4342c38179131e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-07 18:13:09 +02:00
Simon Hausmann b407a77380 Fix incorrect vertex data and rendering when shapes change scene
When changing scene, the stroke vertices were left with uninitialized
stroke colors when the item is re-attached to the scene. Marking the
shape data as overall dirty and triggering a polish ensures that the
data is kept in sync.

Change-Id: I3f472734a97908e6e8f6e58230c0c53dcc041868
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Fixes: QTBUG-77332
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-08-07 13:25:06 +02:00
Laszlo Agocs 88cc9d692f Implement QSG_VISUALIZE for RHI
Change-Id: I6343f316e2ecff4e4d7454fb450a1bd0c5a917b8
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-07 11:50:27 +02:00
Simon Hausmann c273175ffe Fix tests in qtquickcontrols 1 and 2
This patch partially reverts the 5.15 related #ifdefs from commit
f38e071f5b. Those were introduced without
any test coverage and our own modules (qtquickcontrols 1 and 2) were not
tested with it or adapted. The change of behavior breaks our own
existing code.

Task-number: QTBUG-33444
Change-Id: Ie9823638c1a02281798b725f745b15e622f837c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-08-07 11:07:03 +02:00
Jan Arve Sæther 5f530c252b Skip the test function that uses QProcess on Android
See also c3059391fea326b7115cf038ecdad8e820a0c2d5 in qtbase.

Change-Id: I30d4e7349fa7d7604f9ef90692cd7749cd6728bc
Task-number: QTBUG-73512
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-08-05 09:26:58 +00:00
Laszlo Agocs 924beea161 Fix 3+ level stencil clips on the rhi path
Change-Id: Id1e0b904ba7273e63fb63ea53c513bde20dc9759
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-02 13:04:54 +02:00
Laszlo Agocs a22b44266b Change rhi-related debug prints to categorized logging
Change-Id: I4e8d3111a2f3b77e984756cc9eef49d42f0b647c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-02 13:04:46 +02:00
Sona Kurazyan 55a0fe4539 Remove usages of deprecated QSignalMapper
The code using QSignalMapper relies on dynamic property inspection,
and therefore can't use the lambda syntax for capturing the int value.

Since there is only one sender object, replace QSignalMapper with a
simpler mapper class, which emits the mapped signal by passing the
saved member value.

Task-number: QTBUG-76491
Change-Id: I6e8e527b1a92d39a1711d85c203df704c293d294
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-01 14:30:53 +00:00
Marc Mutz 4bac72aa13 Port from QMutex::Recursive to QRecursiveMutex
Change-Id: I5bf128b4479971e87d377707f2ebf267ccba1f1d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-07-31 16:10:19 +02:00
Laszlo Agocs 1d9645576e Re-enable colors with both gl and rhi glyph caches
Follow up to the 5.13->dev merge where the lack of the qt5 submodule
update made it impossible to use the new color argument.

Also implements the color argument for the rhi variant of the glyph
cache.

Change-Id: Ie6c6ba3d647335eb6173d0c9f7fbe3a4ed6b1f24
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 14:03:10 +00:00
Laszlo Agocs 3cff8b2718 Make openvg compile
The plugin is not tested in any form in CI, and some of the internal
changes in the RHI patch has some consequences here as well. Adapt
as necessary. Have not tested the plugin in practice but it compiles
now.

Change-Id: I482fa34802d0bd4d44570f852298c1227cf0bb71
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-30 19:20:16 +02:00
Laszlo Agocs 595a90f991 Have an autorelease pool for each frame on the render thread
Required with Metal. Drawables and various system resources get
autoreleased and there is no pool to handle these on the SG render
thread by default.

This may present a slight perf hit in debug builds due to
QMacAutoReleasePool doing smart but - for us - unnecessary stuff
every time (so in our case, every frame) but will do for now.

This complements the QRhiMetal change for not holding onto the
drawable when skipping the present. The pool is essential then
to prevent nextDrawable from starving and so blocking.

Task-number: QTBUG-76953
Change-Id: Iaf803a0e20504d6b349d3564eda1677868fb29ef
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-30 19:00:59 +02:00
Laszlo Agocs 25c61c5de8 Avoid locking up on resize with threaded loop and the rhi
This was visible on X11 only because there beginFrame() happened
to fail once or twice with out-of-date swapchain when there were
a lot of resizes in a row. Handle this case correctly by waking up
the main thread as appropriate.

Change-Id: I67dc18522e1c05070267fd355095324f48259276
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-30 15:37:02 +02:00
Laszlo Agocs 65d9d4b930 Re-enable threaded render loop with Vulkan on Linux
Change-Id: I05440c54b99ddb6aac9a47e8b33a00be41c13055
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-30 15:36:44 +02:00
Jan Arve Sæther 42872e720b Fix debug output for QQmlError when url is a resource
It failed to show the content of the file that had an error if the file
was embedded as a resource.

Change-Id: Ib8e0627919fa1f7956588ac80179adb8539df0e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-30 11:26:58 +02:00
Jan Arve Sæther f1d213b403 Fix bug in QQmlEngine::setImportPathList() when it had a resource path
The bug is really in QQmlImportDatabase::setImportPathList(). It was
missing the same conversions that was done in
QQmlImportDatabase::addImportPath(), so it failed to use a resource path
as a import path because it did not convert ":/foo" to "qrc:/foo".

We therefore just use addImportPath() to ensure the paths are converted
properly.

Before this, several autotests in tests/auto/qml/qqmllanguage failed on
Android, since they were calling QQmlEngine::setImportPathList() where the
list had resource paths.

Task-number: QTBUG-73512
Change-Id: Idc64f5ad20ec665df7cb57ea1c346bc0975c3b0d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-30 11:26:01 +02:00
Jan Arve Sæther 1d40ed9d22 Fix qqmlexpression failures for Android
Should load from resource on Android...

Task-number: QTBUG-73512
Change-Id: I29f74e896000aeb2b42e27dd739c505d7838b605
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-29 10:05:07 +00:00
Jan Arve Sæther 10bbc7095f Fix qqmlimport failures for Android
Task-number: QTBUG-73512
Change-Id: I50f69f2f071dca2adde1134991963b5c9220219c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-29 10:04:51 +00:00
Liang Qi 93619c8215 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-26 18:25:20 +02:00
Liang Qi d526a72c44 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/quick/handlers/qquickpointerdevicehandler.cpp
	src/quick/scenegraph/qsgdefaultglyphnode.cpp
	src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
	src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
	tests/auto/qml/qjsengine/tst_qjsengine.cpp

Done-With: Jan Arve Sæther <jan-arve.saether@qt.io>
Done-With: Laszlo Agocs <laszlo.agocs@qt.io>
Change-Id: I35749152f8dce44b9af8d52b1283629879010f11
2019-07-26 17:05:34 +02:00
Fabian Kosmale cbe445dd91 linter: Cover all supported JavaScript functions
+ qDebug/commented out code cleanup

Change-Id: Id6a4410391eed2fbf6ff0dd7aaffa1de4d5b892c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-26 11:14:35 +02:00
Fabian Kosmale 66368ffdd9 qmllint: Improve parent handling
- Do not warn about parent access in unknown components
  This avoids false positive warnings when an imported component could not
  be found (or when it actually was not imported).
  We still warn about the component which could not be found, so the user
  is still informed that something is not right.

  We also still emit a warning when we know the properties of a component,
  and parent is not one of them.
- Do not recommend the use of parent to address the root components
  properties. For this to work, we would need to know whether the root
  component reparents its children or not. Moreover, id lookups are
  actually faster than parent lookups.

Change-Id: I83d0e71e4bf20d34a3e6d836c2b123b2bf0d416e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-26 09:00:07 +02:00
Fabian Kosmale 53e7927fdf qmllint: Improve signal handler recommendations
- Fix the case where multiple unqualified accesses would be mapped to
  the same signal (wrong in all but one cases), as the event parameter
  has the same name and we were using a QHash. Fixed by using QMultiHash
  and searching for the matching signal handler (by location)
- Recommend arrow functions for single line event handlers

Change-Id: I3cbb85fe0e49b454908ca03b4c86318ef02e364c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-25 13:13:16 +02:00
Qt Forward Merge Bot aeec2f94c3 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-24 01:00:36 +02:00
Qt Forward Merge Bot 45023ae342 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I081bcb9cc238e6cff5f8a23b684c5d6f76dba047
2019-07-24 01:00:27 +02:00
Fabian Kosmale d94dd247ec Do not search for Singletons from more recent versions
This would break importing older versions of a module, as we would try
to locate a singleton which does not exist in this version.

Fixes: QTBUG-77102
Change-Id: I78be1ec111d2be26a14b2a94bbf743cf6238cddd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-23 16:38:07 +02:00
Fabian Kosmale c0e0c755a1 Support top level generator functions
Extends grammar to support generator functions in QML components and
adjusts codegen accordingly

The corresponding test case must be blacklisted in tst_qmlmin, as qmlmin
cannot handle yield statements

Fixes: QTBUG-77096
Change-Id: I47d45dd56289cdf073b41932a585259d3052de04
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-23 16:37:41 +02:00
Fabian Kosmale da14688140 Fix nullptr handling in binding
Fixes: QTBUG-77027
Change-Id: I61d5a20329ffe95af810b89e338eee2bc10bfe04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-22 16:00:52 +02:00
Tasuku Suzuki b0e19e1d08 Fix label name of features.qml-object-model
Change-Id: I8a35e51f87cfa49bdec834cca65ef169dd76b750
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-22 19:18:20 +09:00