change main item name

This commit is contained in:
Gaelle Braud 2023-10-26 09:58:11 +02:00
parent c643be5d21
commit 17728d5c07
3 changed files with 9 additions and 9 deletions

View file

@ -5,7 +5,7 @@ import QtQuick.Controls 2.2 as Control
import Linphone import Linphone
ColumnLayout { ColumnLayout {
id: carouselRoot id: mainItem
property list<Component> itemsList property list<Component> itemsList
property int currentIndex: carouselStackLayout.currentIndex property int currentIndex: carouselStackLayout.currentIndex
@ -30,9 +30,9 @@ ColumnLayout {
Component.onCompleted: { Component.onCompleted: {
// The animation is not working until the slide // The animation is not working until the slide
// has been displayed once // has been displayed once
for (var i = 0; i < carouselRoot.itemsList.length; ++i) { for (var i = 0; i < mainItem.itemsList.length; ++i) {
// const newObject = Qt.createQmlObject(carouselRoot.itemsList[i], carouselStackLayout); // const newObject = Qt.createQmlObject(mainItem.itemsList[i], carouselStackLayout);
carouselRoot.itemsList[i].createObject(carouselStackLayout) mainItem.itemsList[i].createObject(carouselStackLayout)
var button = carouselButton.createObject(carouselButtonsLayout, {slideIndex: i, stackLayout: carouselStackLayout}) var button = carouselButton.createObject(carouselButtonsLayout, {slideIndex: i, stackLayout: carouselStackLayout})
button.buttonClicked.connect(goToSlideAtIndex) button.buttonClicked.connect(goToSlideAtIndex)
currentIndex = i currentIndex = i
@ -73,7 +73,7 @@ ColumnLayout {
var currentItem = items[currentIndex] var currentItem = items[currentIndex]
var crossFaderAnim = crossFader.createObject(parent, {fadeInTarget: currentItem, mirrored: (previousIndex > currentIndex)}) var crossFaderAnim = crossFader.createObject(parent, {fadeInTarget: currentItem, mirrored: (previousIndex > currentIndex)})
crossFaderAnim.restart() crossFaderAnim.restart()
carouselRoot.currentIndex = currentIndex mainItem.currentIndex = currentIndex
} }
} }
RowLayout { RowLayout {

View file

@ -4,7 +4,7 @@ import QtQuick.Controls as Control
import Linphone import Linphone
ColumnLayout { ColumnLayout {
id: root id: mainItem
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
signal useSIPButtonClicked() signal useSIPButtonClicked()
RowLayout { RowLayout {
@ -50,7 +50,7 @@ ColumnLayout {
Layout.topMargin: 40 Layout.topMargin: 40
inversedColors: true inversedColors: true
text: "Use SIP Account" text: "Use SIP Account"
onClicked: {root.useSIPButtonClicked()} onClicked: {mainItem.useSIPButtonClicked()}
} }
} }
} }

View file

@ -4,7 +4,7 @@ import QtQuick.Controls as Control
import Linphone import Linphone
LoginLayout { LoginLayout {
id: root id: mainItem
signal useSIPButtonClicked() signal useSIPButtonClicked()
titleContent: RowLayout { titleContent: RowLayout {
@ -36,7 +36,7 @@ LoginLayout {
} }
centerContent: LoginForm { centerContent: LoginForm {
onUseSIPButtonClicked: root.useSIPButtonClicked() onUseSIPButtonClicked: mainItem.useSIPButtonClicked()
} }
} }