Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. After deleting a list item in swipe view, swipe area doesn't change when using tabs

After deleting a list item in swipe view, swipe area doesn't change when using tabs

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 196 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shebin
    wrote on last edited by
    #1

    I have a list view inside swipe view. When I delete an item from the list view, clicking on the tab button doesn't move swipe area.

    After I mouse click on the swipe view area I can see the swipe area changing to the tab position. Can somebody please explain to me what's going on? Is this a bug or am I missing something ?

    Swipe area works if I drag. I can see both tab index and swipe index updating.

    import QtQuick 2.14
    import QtQuick.Controls 2.14
    import QtQuick.VirtualKeyboard 2.14
    
    ApplicationWindow {
        id: window
        visible: true
        width: 640
        height: 480
        title: qsTr("Tabs")
    
        SwipeView {
            id: swipeView
            anchors.fill: parent
            currentIndex: tabBar.currentIndex
    
            ListView {
                width: 200
                height: 200
                id: listView1
                Component.onCompleted: {
                    let modelContents = {
                        "name": "1"
                    }
                    model1.append(modelContents)
                    model1.append(modelContents)
                    model1.append(modelContents)
                }
    
                model: ListModel {
                    id: model1
                }
    
                delegate: Button {
                    text: name
                    onPressed: {
                        model1.remove(index)
                    }
                }
            }
    
            ListView {
                width: 200
                height: 200
                id: listView2
                Component.onCompleted: {
                    let modelContents = {
                        "name": "1"
                    }
                    model2.append(modelContents)
                    model2.append(modelContents)
                    model2.append(modelContents)
                }
    
                model: ListModel {
                    id: model2
                }
    
                delegate: Button {
                    text: name
                    onPressed: {
                        model2.remove(index)
                    }
                }
            }
        }
    
        footer: TabBar {
            id: tabBar
            currentIndex: swipeView.currentIndex
    
            TabButton {
                text: qsTr("Page 1")
            }
            TabButton {
                text: qsTr("Page 2")
            }
        }
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved