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. QML set tab property from outside

QML set tab property from outside

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 652 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.
  • H Offline
    H Offline
    haris123
    wrote on last edited by haris123
    #1

    I need to set tabview tab item property from outside tab, but below giving me the error. where CustomItem is a custom qml component.

    Rectangle {
            id: main_background
    
       TabView {
                id: setting_tab
      
                Tab {
                      CustomItem{
                         id: customId
                          indexofitem: -1
                      }
                }
    }
    
    //this function call from another qml
     function changeIndex(idx){
           customId.indexofitem = idx
     }
    }
    
    p3c0P 1 Reply Last reply
    0
    • H haris123

      I need to set tabview tab item property from outside tab, but below giving me the error. where CustomItem is a custom qml component.

      Rectangle {
              id: main_background
      
         TabView {
                  id: setting_tab
        
                  Tab {
                        CustomItem{
                           id: customId
                            indexofitem: -1
                        }
                  }
      }
      
      //this function call from another qml
       function changeIndex(idx){
             customId.indexofitem = idx
       }
      }
      
      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @haris123 If CustomItem is the only child inside Tab then a simple way:

      setting_tab.getTab(0).children[0].indexofitem
      

      157

      1 Reply Last reply
      1

      • Login

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