Updating from qtquickcontrols 1 to qtquickcontrols 2
Closed, ResolvedPublic

Description

Since Qt5.7, there has been a new version of the QtQuick Controls: https://doc.qt.io/qt-5.11/qtquickcontrols2-differences.html
The version 2 should be faster and take less resources.
We are actually using the version 1.

All QtQuick 1 item don't have an equivalent in QtQuick 2 but we need to find on how to update to QtQuick 2.
Note that we can't commit this as long as we have Qt5.6 as minimal requirement.

All the changes to apply can be found in https://invent.kde.org/education/gcompris/-/commit/e01e7531546837e29ebb0439b11fa2376c05bac7:

  • Button -> GCButton
  • ExclusiveGroup -> ButtonGroup (in Categorisation/PlayPiano)
  • Qt: 5.6.0 -> 5.7.0 in CMakeLists.txt
  • Ship good plugin in src/core/CMakeLists.txt
  • Slider: minimumValue/maximumValue ->from/to, scrollEnabled -> wheelEnabled
  • ProgressBar: minimumValue/maximumValue ->from/to
  • TextField: textColor -> color, remove style (Menu.qml)

Missing:

  • StackView
  • Calendar

WIP in : https://invent.kde.org/education/gcompris/-/tree/calendar_no_qtquick
todo list:

For Calendar activity:
ship for

  • android
  • windows
  • mac
  • linux
  • check if no need of the qml files in the package for QtQuick.Controls2?
  • disable activities if calendar shared library not existing?
  • better display the rectangle for days
  • navigation bar needs to always be displayed
  • fix navigation bar display in find_the_day activity
  • handle resizing
  • check if builds with Qt5.7 (at least remove required in MonthGridDelegate)

Related Objects

jjazeix created this task.Dec 8 2018, 8:36 PM
jjazeix added a comment.EditedDec 20 2018, 11:38 AM


provided by @blaws during GCi. To be checked and completed

jjazeix added a subscriber: blaws.Dec 20 2018, 11:39 AM

WIP: https://cgit.kde.org/gcompris.git/log/?h=QtControls2
Missing:

  • main.cpp (StackView)
  • calendar (Calendar, no equivalent in QuickControls 2.0)

For calendar, using Qt.Labs is not a great option as it needs to be deployed with the application and it would be better to avoid adding a new dependency. Storing the Qt Calendar api in the code may be better if not too big...

Indeed, Qt.Labs is not a great option, also as they state "Note: Types in Qt.labs modules are not guaranteed to remain compatible in future versions."

While it should be possible to use both controls 1 and 2, if it's only for the Calendar it will be lighter to just copy the Calendar part in our code.

jjazeix updated the task description. (Show Details)Sep 27 2020, 8:06 AM
jjazeix updated the task description. (Show Details)Apr 11 2021, 4:48 PM
jjazeix updated the task description. (Show Details)
jjazeix updated the task description. (Show Details)Apr 11 2021, 5:08 PM
jjazeix updated the task description. (Show Details)Apr 17 2021, 7:31 AM
jjazeix updated the task description. (Show Details)Apr 17 2021, 8:20 AM
jjazeix updated the task description. (Show Details)Apr 17 2021, 8:54 AM
jjazeix updated the task description. (Show Details)Apr 17 2021, 9:39 AM
jjazeix updated the task description. (Show Details)Apr 17 2021, 9:41 AM
jjazeix added a comment.EditedFeb 5 2022, 10:43 AM

Calendar has been added in Qt6.3: https://doc-snapshots.qt.io/qt6-6.3/whatsnew63.html#qt-quick-controls-module. As it is not a LTS, we'll need to find on how to handle it... Maybe copy the code of the module when we use Qt6.2.
We need to check the effort of having it in Qt5.15 (5.12?), it could solve some of our current issues too.

Edit: this is the same as the one we try to use as submodule: https://github.com/qt/qtdeclarative/commit/dbf7048ae265f43dc8b097dd55e6de21e53ed645#diff-fd9a386947ff531a54e5a24796002f87590766cd3b0b106f65f510cdc661edb1

jjazeix moved this task from Backlog to WIP on the GCompris: Improvements board.Mar 27 2022, 11:18 AM
jjazeix claimed this task.
jjazeix closed this task as Resolved.Apr 24 2022, 2:59 PM
jjazeix moved this task from WIP to Done on the GCompris: Improvements board.