SHARE
TWEET

Dynamic button

a guest Aug 10th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TabBar {
  2.     id: bar
  3.     contentHeight: 30
  4.     width: parent.width
  5.  
  6.     Repeater {
  7.         model: buttonModel
  8.  
  9.         TabButton {
  10.             text: model + " " + model.index
  11.             width: Math.max(100, bar.width / 5)
  12.         }
  13.     }
  14. }
  15.  
  16. ListModel { id: buttonModel }
  17.  
  18. Button {
  19.     text: "ADD"
  20.     onClicked: buttonModel.append({text: "Test button"})
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top