Guest User

QML Ribbon hacky

a guest
Aug 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.25 KB | None | 0 0
  1. import QtQuick 2.12
  2. import QtQuick.Window 2.12
  3. import QtQuick.Controls 2.13
  4. import QtQuick.Layouts 1.12
  5.  
  6. Window {
  7.     visible: true
  8.     width: 1366
  9.     height: 768
  10.     title: qsTr("Hello World")
  11.  
  12.     Rectangle {
  13.         id:nav
  14.         height: 150
  15.  
  16.         anchors {
  17.             top:parent.top
  18.             right:parent.right
  19.             left:parent.left
  20.         }
  21.         TabBar {
  22.             id: tabBar
  23.             height: 79
  24.             anchors {
  25.                 top:parent.top
  26.                 right:parent.right
  27.                 left:parent.left
  28.             }
  29.             TabButton {
  30.                  text: qsTr("Home")
  31.              }
  32.              TabButton {
  33.                  text: qsTr("Discover")
  34.              }
  35.              TabButton {
  36.                  text: qsTr("Activity")
  37.              }
  38.         }
  39.  
  40.         StackLayout {
  41.             id:stackLayoutNavigation
  42.             height: 150
  43.             anchors {
  44.                 top:tabBar.bottom
  45.                 right:parent.right
  46.                 left:parent.left
  47.             }
  48.             currentIndex: tabBar.currentIndex
  49.             Row {
  50.                 spacing: 40
  51.                 anchors.margins: 30
  52.                 Button {
  53.                     text: qsTr("btn 1")
  54.                 }
  55.                 Button {
  56.                     text: qsTr("btn 1")
  57.                 }
  58.                 Button {
  59.                     text: qsTr("btn 1")
  60.                 }
  61.                 Button {
  62.                     text: qsTr("btn 1")
  63.                 }
  64.             }
  65.             Row {
  66.                 anchors.margins: 30
  67.                 spacing: 40
  68.                 Button {
  69.                     text: qsTr("aaaaaaa1")
  70.                 }
  71.             }
  72.             Row {
  73.                 anchors.margins: 30
  74.                 spacing: 40
  75.                 Button {
  76.                     text: qsTr("bbbbbbbbbb 1")
  77.                 }
  78.                 Button {
  79.                     text: qsTr("bbbbbbbbbbb 1")
  80.                 }
  81.  
  82.             }
  83.         }
  84.     }
  85.  
  86.  
  87.     Rectangle {
  88.         id:stackLayoutContent
  89.          color: "gray"
  90.         anchors {
  91.             top:nav.bottom
  92.             right:parent.right
  93.             bottom:parent.bottom
  94.             left:parent.left
  95.         }
  96.  
  97.  
  98.     }
  99.  
  100. }
Add Comment
Please, Sign In to add comment