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. Customize TabView/TabBar.
QtWS25 Last Chance

Customize TabView/TabBar.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlqtquick controltabviewstyleqtquick2
1 Posts 1 Posters 1.5k Views
  • 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.
  • P Offline
    P Offline
    pra7
    wrote on 15 Jul 2017, 12:54 last edited by
    #1

    I am a beginner and I need to do some customization for tabView/tabBar ,Please refer below image:

    0_1500123193062_tab.jpg

    W.r.t IMAGE:

    1. When I customized tab using TabViewStyle I am getting as (1).

    TabView {
    id: tv
    width: parent.width
    height: parent.height
    antialiasing: true

    style: TabViewStyle {
    frameOverlap: -1

    tab: Rectangle {
        color: "Transparent"
        implicitWidth: text1.width + 50
        implicitHeight: 20
        radius: 2
        smooth: true
        Canvas {
            id: canvas1
            anchors.fill: parent
            width: parent.width
            height: parent.height
            onPaint: {
                styleData.selected ? drawTab(canvas1,"#0C3142") :
                                     drawTab(canvas1,"Transparent") //Some custom JS function to draw a object
            }
    
            function drawTab() { // *** some drawing
                console.log('draw')
            }
    
    
    
            Text {
                id: text1
                height: parent.height
                verticalAlignment: Text.AlignVCenter
                anchors.left : parent.left
                anchors.leftMargin: 15
                text: styleData.title
                color: "white"
            }
        }
    }
    
    frame: Rectangle {
        width: parent.width
        height: parent.height
        color: "Transparent"
        border.color:"white"
    }
    tabBar: Rectangle {
        color: "Transparent"
        anchors.fill: parent
    }
    

    }

    Tab {
    id: tab1
    title: "Tab1"
    }
    Tab{
    id: tab2
    title: "Tab2"

    }
    2) Final Output in which there should be no line for selected tab.

    Please suggest.

    1 Reply Last reply
    0

    1/1

    15 Jul 2017, 12:54

    • Login

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