diff options
17 files changed, 19 insertions, 17 deletions
diff --git a/examples/quickcontrols2/chattutorial/chapter3-navigation/ConversationPage.qml b/examples/quickcontrols2/chattutorial/chapter3-navigation/ConversationPage.qml index 90a846ac..94942191 100644 --- a/examples/quickcontrols2/chattutorial/chapter3-navigation/ConversationPage.qml +++ b/examples/quickcontrols2/chattutorial/chapter3-navigation/ConversationPage.qml @@ -78,6 +78,7 @@ Page { anchors.fill: parent ListView { + id: listView Layout.fillWidth: true Layout.fillHeight: true Layout.margins: pane.leftPadding + messageField.leftPadding @@ -89,7 +90,7 @@ Page { delegate: Row { readonly property bool sentByMe: index % 2 == 0 - anchors.right: sentByMe ? parent.right : undefined + anchors.right: sentByMe ? listView.contentItem.right : undefined spacing: 6 Rectangle { diff --git a/examples/quickcontrols2/chattutorial/chapter4-models/ConversationPage.qml b/examples/quickcontrols2/chattutorial/chapter4-models/ConversationPage.qml index 6684c233..d616fa38 100644 --- a/examples/quickcontrols2/chattutorial/chapter4-models/ConversationPage.qml +++ b/examples/quickcontrols2/chattutorial/chapter4-models/ConversationPage.qml @@ -92,7 +92,7 @@ Page { recipient: inConversationWith } delegate: Column { - anchors.right: sentByMe ? parent.right : undefined + anchors.right: sentByMe ? listView.contentItem.right : undefined spacing: 6 readonly property bool sentByMe: model.recipient !== "Me" diff --git a/examples/quickcontrols2/chattutorial/chapter5-styling/ConversationPage.qml b/examples/quickcontrols2/chattutorial/chapter5-styling/ConversationPage.qml index 790f9ee9..31238454 100644 --- a/examples/quickcontrols2/chattutorial/chapter5-styling/ConversationPage.qml +++ b/examples/quickcontrols2/chattutorial/chapter5-styling/ConversationPage.qml @@ -92,7 +92,7 @@ Page { recipient: inConversationWith } delegate: Column { - anchors.right: sentByMe ? parent.right : undefined + anchors.right: sentByMe ? listView.contentItem.right : undefined spacing: 6 readonly property bool sentByMe: model.recipient !== "Me" diff --git a/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc b/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc index 49e98068..bc0ca846 100644 --- a/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc +++ b/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc @@ -490,7 +490,7 @@ we distinguish between different authors in three ways: \list \li Messages sent by the user are aligned to the right side of the screen -by setting \c anchors.right to \c parent.right. +by setting \c anchors.right to \c listView.contentItem.right. \li By setting the \c visible property of the avatar (which is simply a Rectangle for now) based on \c sentByMe, we only show it if the message was diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index 44090b8a..504a36c7 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -173,7 +173,7 @@ ApplicationWindow { anchors.fill: parent delegate: ItemDelegate { - width: parent.width + width: listView.width text: model.title highlighted: ListView.isCurrentItem onClicked: { diff --git a/examples/quickcontrols2/gallery/pages/DelegatePage.qml b/examples/quickcontrols2/gallery/pages/DelegatePage.qml index 30f07be1..20ceaa6b 100644 --- a/examples/quickcontrols2/gallery/pages/DelegatePage.qml +++ b/examples/quickcontrols2/gallery/pages/DelegatePage.qml @@ -110,7 +110,6 @@ Pane { CheckDelegate { text: labelText - width: parent.width } } diff --git a/examples/quickcontrols2/imagine/automotive/qml/automotive.qml b/examples/quickcontrols2/imagine/automotive/qml/automotive.qml index 91e3bf7c..2c001db2 100644 --- a/examples/quickcontrols2/imagine/automotive/qml/automotive.qml +++ b/examples/quickcontrols2/imagine/automotive/qml/automotive.qml @@ -269,6 +269,7 @@ ApplicationWindow { Layout.preferredHeight: 128 ListView { + id: stationListView clip: true anchors.fill: parent @@ -296,7 +297,7 @@ ApplicationWindow { } delegate: ItemDelegate { id: stationDelegate - width: parent.width + width: stationListView.width height: 22 text: model.name font.pixelSize: fontSizeExtraSmall diff --git a/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml b/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml index de4fd281..28ed5861 100644 --- a/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml +++ b/examples/quickcontrols2/imagine/musicplayer/musicplayer.qml @@ -431,6 +431,7 @@ ApplicationWindow { Layout.fillHeight: true ListView { + id: filesListView clip: true anchors.fill: parent model: ListModel { @@ -446,7 +447,7 @@ ApplicationWindow { } delegate: ItemDelegate { text: model.author + " - " + model.album + " - " + model.track - width: parent.width + width: filesListView.width } ScrollBar.vertical: ScrollBar { diff --git a/examples/quickcontrols2/sidepanel/sidepanel.qml b/examples/quickcontrols2/sidepanel/sidepanel.qml index e2473ac9..a0c69fb2 100644 --- a/examples/quickcontrols2/sidepanel/sidepanel.qml +++ b/examples/quickcontrols2/sidepanel/sidepanel.qml @@ -132,7 +132,7 @@ ApplicationWindow { delegate: ItemDelegate { text: qsTr("Title %1").arg(index + 1) - width: parent.width + width: listView.width } ScrollIndicator.vertical: ScrollIndicator { } diff --git a/examples/quickcontrols2/swipetoremove/swipetoremove.qml b/examples/quickcontrols2/swipetoremove/swipetoremove.qml index b4b0d588..65127a1a 100644 --- a/examples/quickcontrols2/swipetoremove/swipetoremove.qml +++ b/examples/quickcontrols2/swipetoremove/swipetoremove.qml @@ -67,7 +67,7 @@ ApplicationWindow { id: delegate text: modelData - width: parent.width + width: listView.width //! [delegate] swipe.right: Rectangle { diff --git a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml index b3102771..a8e99345 100644 --- a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml +++ b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml @@ -77,7 +77,7 @@ ListView { delegate: Item { height: missedCallsView.height width: missedCallsView.width / 2 - anchors.left: parent.horizontalCenter + anchors.left: missedCallsView.contentItem.horizontalCenter Column { spacing: 15 diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index b30293f5..e9f93d66 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -53,7 +53,7 @@ T.ComboBox { rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) delegate: ItemDelegate { - width: parent.width + width: ListView.view.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData palette.text: control.palette.text palette.highlightedText: control.palette.highlightedText diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index 1eeacf8b..d0e4b564 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -55,7 +55,7 @@ T.ComboBox { rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) delegate: MenuItem { - width: parent.width + width: ListView.view.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex === index diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index 92937826..d657e734 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -59,7 +59,7 @@ T.ComboBox { bottomInset: background ? -background.bottomInset || 0 : 0 delegate: ItemDelegate { - width: parent.width + width: ListView.view.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex === index diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index e4ee332b..e4e5f935 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -63,7 +63,7 @@ T.ComboBox { Material.foreground: flat ? undefined : Material.primaryTextColor delegate: MenuItem { - width: parent.width + width: ListView.view.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData Material.foreground: control.currentIndex === index ? parent.Material.accent : parent.Material.foreground highlighted: control.highlightedIndex === index diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index fd2d8935..9b88ccf9 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -56,7 +56,7 @@ T.ComboBox { Universal.theme: editable && activeFocus ? Universal.Light : undefined delegate: ItemDelegate { - width: parent.width + width: ListView.view.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex === index diff --git a/tests/auto/qquickdrawer/data/flickable.qml b/tests/auto/qquickdrawer/data/flickable.qml index 4afef66b..09d43029 100644 --- a/tests/auto/qquickdrawer/data/flickable.qml +++ b/tests/auto/qquickdrawer/data/flickable.qml @@ -67,7 +67,7 @@ ApplicationWindow { id: flickable model: 100 delegate: ItemDelegate { - width: parent.width + width: flickable.width text: index } } |