ubports / ubuntu-ui-toolkit

Moved to https://gitlab.com/ubports/core/lomiri-ui-toolkit
https://gitlab.com/ubports/core/lomiri-ui-toolkit
GNU Lesser General Public License v3.0
13 stars 21 forks source link

Compatibility with Qt 5.15 #83

Closed z3ntu closed 4 years ago

z3ntu commented 4 years ago

Reference:

There are a few new deprecation warnings:

file:///[...]/qml/Ubuntu/Components/1.3/MainView.qml:195:9: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }

According to https://github.com/qt/qtdeclarative/commit/a2eef6b511988b2435c4e39b6b5551e857ce7775 this new syntax isn't supported in Qt 5.12 (i.e. definitely not in Qt 5.9) as such we need to wait until the minimum Qt version is > 5.12 to fix this.

file:///[...]/qml/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml:1109:5: QML Binding: Not restoring previous value because restoreMode has not been set.
This behavior is deprecated.
You have to import QtQml 2.15 after any QtQuick imports and set
the restoreMode of the binding to fix this warning.
In Qt < 6.0 the default is Binding.RestoreBinding.
In Qt >= 6.0 the default is Binding.RestoreBindingOrValue.

I haven't looked further into this warning yet

I believe also some components aren't actually working here but my test environment is quite incomplete so it might just be the environment

file:///[...]/qml/Ubuntu/Components/Pickers/1.3/Picker.qml:396: TypeError: Cannot read property 'toString' of undefined

edit: Object.prototype is undefined, not sure why that is

z3ntu commented 4 years ago

Just checked, it still compiles with Qt 5.14!

z3ntu commented 4 years ago

Extensive test with ./gallery.sh (compared on PinePhone vs. Qt 5.15 desktop):

z3ntu commented 4 years ago

Huh...

$ ./tests/Gallery/gallery test1.qml
qml: Object.prototype: undefined
^C
$ ./tests/Gallery/gallery test2.qml
qml: Object.prototype: [object Object]
^C
==> test1.qml <==
import QtQuick 2.4
import Ubuntu.Components 1.3

Item {
    Component.onCompleted: {
        console.log("Object.prototype: " + Object.prototype);
    }
}

==> test2.qml <==
import QtQuick 2.4

Item {
    Component.onCompleted: {
        console.log("Object.prototype: " + Object.prototype);
    }
}

So literally just importing Ubuntu.Components makes Object.prototype become undefined for some reason. Likely some nice breakage in some internal APIs, yippie

z3ntu commented 4 years ago

Object.prototype thing is already broken in Qt 5.12 :(

qt@6c665f0c562a:/var/build$ ./tests/Gallery/gallery test2.qml
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-qt'
qml: Object.prototype: [object Object]
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: i965
^C
qt@6c665f0c562a:/var/build$ ./tests/Gallery/gallery test1.qml
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-qt'
qml: Object.prototype: undefined
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: i965
dobey commented 4 years ago

So literally just importing Ubuntu.Components makes Object.prototype become undefined for some reason. Likely some nice breakage in some internal APIs, yippie

I really don't know how uitk could break the JavaScript internals in Qt, that seems unlikely.

Also, I think I've mostly got this worked around in my 5.12 update branch of uitk for the Picker component.

z3ntu commented 4 years ago

Works fine in Qt 5.11 so it's a Qt 5.12 breakage:

qt@0f48238d2630:/var/build$ ./tests/Gallery/gallery test1.qml
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-qt'
qml: Object.prototype: [object Object]
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: failed to open /dev/dri/card0: No such file or directory
libGL error: failed to load driver: i965
^C
qt@0f48238d2630:/var/build$ ./tests/Gallery/gallery test2.qml
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-qt'
qml: Object.prototype: [object Object]
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: failed to open /dev/dri/card0: No such file or directory
libGL error: failed to load driver: i965
z3ntu commented 4 years ago

Rebased on xenial_-_qt-5-12 branch, bottomedge and pickers work fine now! Thanks @dobey and @peat-psuwit !

Now, what are the plans to merge the xenial_-_qt-5-12 branch into xenial?

dobey commented 4 years ago

Now, what are the plans to merge the xenial_-_qt-5-12 branch into xenial?

When all the surrounding issues are resolved and we get qt 5.12 in.

z3ntu commented 4 years ago

@dobey Should I target this PR to xenial_-_qt-5-12 maybe?

CI currently fails with

The following packages have unmet dependencies:
 pbuilder-satisfydepends-dummy : Depends: qtdeclarative5-dev (>= 5.12.8~) but 5.9.5-0ubports3 is to be installed.
dobey commented 4 years ago

@dobey Should I target this PR to xenial_-_qt-5-12 maybe?

Yes, I think so, since you've rebased on it already. Should also make the list of commits in here much smaller if you do. :)

z3ntu commented 4 years ago

@dobey done