pillexyz

Untitled

Jan 8th, 2025 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.79 KB | Source Code | 0 0
  1. // This is how I call the append
  2. // macroItemModel.append({macroName: macroNameInput.textInputValue, macroCode: mainKeyInput.textInputValue + "->" + inputCodeCombined})
  3.  
  4.  
  5. ListModel {
  6.     id: macroItemModel
  7.     //ListElement { macroName: "Unnamed Macro" }
  8. }
  9.  
  10. Column {
  11.     id: macroItemColumn
  12.     //anchors { left: yourMacrosText.left; top: yourMacrosText.bottom; leftMargin: 12; topMargin: 12 }
  13.     width: 130
  14.     spacing: 4
  15.     anchors.top: parent.top
  16.     anchors.topMargin: 54
  17.  
  18.     Repeater {
  19.         model: macroItemModel
  20.  
  21.         delegate: MacroItem {
  22.             required property int index
  23.             containerWidth: macroListContainer.width/1.5
  24.             macroName: model.macroName
  25.             macroCode: model.macroCode
  26.             // macroItemModel.get(index).macroCode
  27.  
  28.             onDeleteButtonClicked: {
  29.                 macroItemModel.remove(index, 1);
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment