Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to remove the border beneath an active tab?
Forum Updated to NodeBB v4.3 + New Features

How to remove the border beneath an active tab?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 739 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.
  • E Offline
    E Offline
    Esor
    wrote on last edited by
    #1

    I am writing a QSS stylesheet and would like to replicate the look in Fusion where there is no border between the active tab and the pane:

    f6d31439-30ad-4c89-87e2-ea3057cb88b2-image.png

    When I apply my own stylesheet there is a border between them like this:

    9141cdf0-8c07-4477-9ccb-29c57232ea73-image.png

    I was reading through the reference docs and saw "Overlapping tabs for the selected state are created by using negative margins or using the absolute position scheme.", but it seems like tabs render underneath the pane and z-index isn't supported in QSS so I don't understand how that's possible, here's what it looks like with a large negative margin:

    980dc0e0-e6dd-4261-bbb6-921a63fd7faf-image.png

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Esor
      wrote on last edited by Esor
      #3

      Ah I found the solution! Christian was correct that the border is for the pane which I already knew, but the problem is that if you disable it you get a blank patch beside the tabs:

      fb0becd8-613b-4c4e-9c34-9d522306e9a0-image.png

      I found the solution here and I don't really understand why it works and doesn't remove the top border like shown above, but it does. To get it working on all sides my solutions was this (I'm using a SCSS to QSS compiler):

      QTabWidget {
      
          &::pane {
              &:top {
                  top: -1px;
              }
      
              &:bottom {
                  bottom: -1px;
              }
      
              &:left {
                  left: -1px;
              }
              &:right {
                  right: -1px;
              }
      }
      

      6539a1ad-f227-4a77-a664-7c9a433a9ebb-image.png

      I'm still missing the border underneath the inactive tab which is not ideal but looks fine with my color set

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        I don't think this border belongs to the tab but the widget below.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        1
        • E Offline
          E Offline
          Esor
          wrote on last edited by Esor
          #3

          Ah I found the solution! Christian was correct that the border is for the pane which I already knew, but the problem is that if you disable it you get a blank patch beside the tabs:

          fb0becd8-613b-4c4e-9c34-9d522306e9a0-image.png

          I found the solution here and I don't really understand why it works and doesn't remove the top border like shown above, but it does. To get it working on all sides my solutions was this (I'm using a SCSS to QSS compiler):

          QTabWidget {
          
              &::pane {
                  &:top {
                      top: -1px;
                  }
          
                  &:bottom {
                      bottom: -1px;
                  }
          
                  &:left {
                      left: -1px;
                  }
                  &:right {
                      right: -1px;
                  }
          }
          

          6539a1ad-f227-4a77-a664-7c9a433a9ebb-image.png

          I'm still missing the border underneath the inactive tab which is not ideal but looks fine with my color set

          1 Reply Last reply
          0

          • Login

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