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. TabView removeTab gives: Invalid attempt to destroy() an indestructible object
Forum Updated to NodeBB v4.3 + New Features

TabView removeTab gives: Invalid attempt to destroy() an indestructible object

Scheduled Pinned Locked Moved QML and Qt Quick
qmltabview
1 Posts 1 Posters 1.5k 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.
  • D Offline
    D Offline
    dstevenson
    wrote on last edited by
    #1

    I'm trying to create a tabview in qml which allows the user to open and close tabs. However I'm getting an error message whenever the removeTab() function is called.

    E:/Qt/Qt5.5.0/5.5/msvc2013/qml/QtQuick/Controls/TabView.qml:150: Error: Invalid attempt to destroy() an indestructible object
    

    A minimal example to reproduce is

    import QtQuick 2.3
    import QtQuick.Controls 1.4
    
    Item {
        Action {
            id: closeTabAction
            shortcut: "Ctrl+W"
            onTriggered: {
                tabView.removeTab(tabView.currentIndex);
            }
        }
    
        TabView {
            id: tabView
            anchors.fill: parent
    
            Repeater {
                model: 4
                delegate: Tab {
                    title: 'tab ' + index
                }
            }
        }
    }
    

    Am I doing something wrong?

    Thanks,
    David

    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