2017-06-09 2 views
1

Avec le code QML suivant:GroupBox » offset SPLITVIEW

SplitView { 
     orientation: Qt.Vertical 

     anchors.fill: parent 

     GroupBox { 
//   id: inputBox 
      title: "First" 
      Layout.fillWidth: true 

      anchors.top: parent.top 

      anchors.topMargin: UI.boxMargin 
      anchors.bottomMargin: UI.boxMargin 
     } 

     GroupBox { 
      title: "Second" 
      Layout.fillWidth: true 

//   x: 15 

//   anchors.topMargin: 15//UI.boxMargin 
//   anchors.bottomMargin: UI.boxMargin 
     } 
    } 

j'ai atteint la conception suivante: enter image description here

Le séparateur se compose de deux lignes: une foncée et l'une des briquets. Je veux ajouter un peu de décalage entre le séparateur et le second GroupBox pour éviter la superposition (moche), mais je n'ai pas réussi jusqu'à maintenant (le code commenté est inutile).

Répondre

1

Ajouter Layout.topMargin au second GroupBox. Par exemple,

SplitView { 
    orientation: Qt.Vertical 
    anchors.fill: parent 

    GroupBox { 
     title: "First" 
     Layout.fillWidth: true 
     height: 80 
    } 
    GroupBox { 
     title: "Second" 
     Layout.fillWidth: true 
     Layout.topMargin: 15 
    } 
}