aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-demo/phone
diff options
context:
space:
mode:
authorIndivara Weerasuriya <indivara.weerasuriya@qt.io>2024-07-30 19:47:24 +0900
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2024-11-20 13:35:26 +0000
commit59ae0b13d2bb14fbf12117f2f55bfcb6f06f104b (patch)
treeba38354db9033675bde1ad07700d796160450f8f /recipes-demo/phone
parenta37e8ed0c8f997e13d719c7e5d956b5febc9cfa5 (diff)
Migrate demo app recipes and patch apps to Qt 6
Bug-AGL: SPEC-5294 Change-Id: I6b9ff940745f88af9a3b69e29917082e52b25f88 Signed-off-by: Indivara Weerasuriya <indivara.weerasuriya@qt.io> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/30141 Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'recipes-demo/phone')
-rw-r--r--recipes-demo/phone/phone/0001-Migrate-to-Qt-6.patch189
-rw-r--r--recipes-demo/phone/phone_git.bb8
2 files changed, 194 insertions, 3 deletions
diff --git a/recipes-demo/phone/phone/0001-Migrate-to-Qt-6.patch b/recipes-demo/phone/phone/0001-Migrate-to-Qt-6.patch
new file mode 100644
index 000000000..5777727a7
--- /dev/null
+++ b/recipes-demo/phone/phone/0001-Migrate-to-Qt-6.patch
@@ -0,0 +1,189 @@
+From e70943a45841b28da16fa8590dc3054401b47591 Mon Sep 17 00:00:00 2001
+From: Indivara Weerasuriya <1806262-indivara@users.noreply.git.qt.io>
+Date: Wed, 24 Jul 2024 09:34:25 +0900
+Subject: [PATCH] Migrate to Qt 6
+
+---
+ app/ContactsView.qml | 3 +--
+ app/Dialer.qml | 14 +++++++-------
+ app/Phone.qml | 6 +++---
+ app/Recents.qml | 8 ++++----
+ app/TabImageButton.qml | 11 ++++++-----
+ 5 files changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/app/ContactsView.qml b/app/ContactsView.qml
+index 66f2199..e9def44 100644
+--- a/app/ContactsView.qml
++++ b/app/ContactsView.qml
+@@ -18,7 +18,6 @@
+ import QtQuick 2.6
+ import QtQuick.Layouts 1.3
+ import QtQuick.Controls 2.0
+-import QtQuick.Controls.Styles 1.4
+ import AGL.Demo.Controls 1.0
+ import PhoneNumber 1.0
+
+@@ -77,7 +76,7 @@ Item {
+ anchors.leftMargin: 200
+ spacing: 100
+ Image {
+- source: model.modelData.photo ? model.modelData.photo : './images/HMI_ContactScreen_ImageHolder-01.svg'
++ source: model.modelData.photo ? model.modelData.photo : 'qrc:/images/HMI_ContactScreen_ImageHolder-01.svg'
+ Layout.preferredWidth: 160
+ Layout.preferredHeight: 160
+ }
+diff --git a/app/Dialer.qml b/app/Dialer.qml
+index 743c742..31fb8c8 100644
+--- a/app/Dialer.qml
++++ b/app/Dialer.qml
+@@ -100,7 +100,7 @@ Item {
+ ImageButton {
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+- offImage: './images/HMI_Phone_Back_Icon.svg'
++ offImage: 'qrc:/images/HMI_Phone_Back_Icon.svg'
+ onClicked: {
+ if (number.text.length > 0)
+ number.text = number.text.substring(0, number.text.length - 1)
+@@ -130,8 +130,8 @@ Item {
+ ListElement { value: '#'; image: 'NumberSign' }
+ }
+ ImageButton {
+- onImage: './images/HMI_Phone_Button_%1_Active-01.svg'.arg(model.image)
+- offImage: './images/HMI_Phone_Button_%1_Inactive-01.svg'.arg(model.image)
++ onImage: 'qrc:/images/HMI_Phone_Button_%1_Active-01.svg'.arg(model.image)
++ offImage: 'qrc:/images/HMI_Phone_Button_%1_Inactive-01.svg'.arg(model.image)
+ onClicked: {
+ number.text += model.value
+ }
+@@ -148,8 +148,8 @@ Item {
+ ToggleButton {
+ id: callButton
+ Layout.alignment: Qt.AlignHCenter
+- onImage: './images/HMI_Phone_Hangup.svg'
+- offImage: './images/HMI_Phone_Call.svg'
++ onImage: 'qrc:/images/HMI_Phone_Hangup.svg'
++ offImage: 'qrc:/images/HMI_Phone_Call.svg'
+ property var active: (number.text.length > 0) || (telephony.callState === "incoming") || (telephony.callState === "active")
+ opacity: active ? 1 : 0.25
+
+@@ -182,7 +182,7 @@ Item {
+ Layout.alignment: Qt.AlignHCenter
+ active: false
+ sourceComponent: ImageButton {
+- offImage: './images/HMI_Phone_Hangup.svg'
++ offImage: 'qrc:/images/HMI_Phone_Hangup.svg'
+ onClicked: {
+ telephony.hangup()
+ }
+@@ -203,7 +203,7 @@ Item {
+ anchors.fill: parent
+ spacing: 20
+ Image {
+- source: './images/HMI_Phone_Contact_BlankPhoto.svg'
++ source: 'qrc:/images/HMI_Phone_Contact_BlankPhoto.svg'
+ }
+ ColumnLayout {
+ Label {
+diff --git a/app/Phone.qml b/app/Phone.qml
+index 6b38f77..6de54f2 100644
+--- a/app/Phone.qml
++++ b/app/Phone.qml
+@@ -41,19 +41,19 @@ ApplicationWindow {
+ contentHeight: 160
+
+ TabImageButton {
+- icon: "./images/ic_contacts_48px.svg"
++ iconSource: "qrc:/images/ic_contacts_48px.svg"
+ text: "Contacts"
+ font.pixelSize: 50
+ }
+
+ TabImageButton {
+- icon: "./images/ic_schedule_48px.svg"
++ iconSource: "qrc:/images/ic_schedule_48px.svg"
+ text: "Recents"
+ font.pixelSize: 50
+ }
+
+ TabImageButton {
+- icon: "./images/ic_dialpad_48px.svg"
++ iconSource: "qrc:/images/ic_dialpad_48px.svg"
+ text: "Dialpad"
+ font.pixelSize: 50
+ }
+diff --git a/app/Recents.qml b/app/Recents.qml
+index 5a516a1..f4d771b 100644
+--- a/app/Recents.qml
++++ b/app/Recents.qml
+@@ -25,11 +25,11 @@ Item {
+
+ function log_icon(type) {
+ if (type === RecentCall.MISSED) {
+- return './images/ic_call_missed_48px.svg'
++ return 'qrc:/images/ic_call_missed_48px.svg'
+ } else if (type === RecentCall.RECEIVED) {
+- return './images/ic_call_received_48px.svg'
++ return 'qrc:/images/ic_call_received_48px.svg'
+ } else if (type === RecentCall.DIALED) {
+- return './images/ic_call_made_48px.svg'
++ return 'qrc:/images/ic_call_made_48px.svg'
+ }
+ }
+
+@@ -53,7 +53,7 @@ Item {
+ Layout.preferredHeight: 150
+ }
+ Image {
+- source: './images/HMI_Phone_Contact_BlankPhoto.svg'
++ source: 'qrc:/images/HMI_Phone_Contact_BlankPhoto.svg'
+ Layout.preferredWidth: 150
+ Layout.preferredHeight: 150
+ }
+diff --git a/app/TabImageButton.qml b/app/TabImageButton.qml
+index 2176595..c707574 100644
+--- a/app/TabImageButton.qml
++++ b/app/TabImageButton.qml
+@@ -41,6 +41,7 @@ import QtQuick.Layouts 1.1
+ import QtQuick.Controls 2.2
+ import QtQuick.Controls.impl 2.2
+ import QtQuick.Templates 2.2 as T
++import QtQuick.Controls.Basic 2.2
+
+ T.TabButton {
+ id: control
+@@ -53,13 +54,13 @@ T.TabButton {
+
+ padding: 6
+
+- property url icon
++ property url iconSource
+
+ contentItem: ColumnLayout {
+ spacing: 20
+ Image {
+ Layout.alignment: Qt.AlignCenter
+- source: control.icon
++ source: control.iconSource
+ width: 96
+ height: 96
+
+@@ -70,7 +71,7 @@ T.TabButton {
+ font: control.font
+ elide: Text.ElideRight
+ opacity: enabled ? 1 : 0.3
+- color: !control.checked ? Default.textLightColor : control.down ? Default.textDarkColor : Default.textColor
++ color: !control.checked ? Basic.textLightColor : control.down ? Basic.textDarkColor : Basic.textColor
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+@@ -78,7 +79,7 @@ T.TabButton {
+ background: Rectangle {
+ implicitHeight: 160
+ color: control.down
+- ? (control.checked ? Default.tabButtonCheckedPressedColor : Default.tabButtonPressedColor)
+- : (control.checked ? "transparent" : Default.tabButtonColor)
++ ? (control.checked ? Basic.tabButtonCheckedPressedColor : Basic.tabButtonPressedColor)
++ : (control.checked ? "transparent" : Basic.tabButtonColor)
+ }
+ }
diff --git a/recipes-demo/phone/phone_git.bb b/recipes-demo/phone/phone_git.bb
index 4c59bcbc3..37330ff79 100644
--- a/recipes-demo/phone/phone_git.bb
+++ b/recipes-demo/phone/phone_git.bb
@@ -6,16 +6,18 @@ SECTION = "apps"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984"
-DEPENDS = "qtquickcontrols2 libqtappfw gstreamer1.0"
+DEPENDS = "qtdeclarative libqtappfw gstreamer1.0"
PV = "1.0+git${SRCPV}"
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/phone;protocol=https;branch=${AGL_BRANCH}"
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/phone;protocol=https;branch=${AGL_BRANCH} \
+ file://0001-Migrate-to-Qt-6.patch \
+ "
SRCREV = "bfcc2fa194474a7bc317583072b62c977ae0fc14"
S = "${WORKDIR}/git"
-inherit qmake5 pkgconfig agl-app
+inherit qt6-qmake pkgconfig agl-app
AGL_APP_NAME = "Phone"