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. changing border of QTabWidget
Forum Updated to NodeBB v4.3 + New Features

changing border of QTabWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 3.2k 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
    EmmanuelC
    wrote on last edited by
    #1

    Hello,

    I simply would like to show/hide general borders of a QTabWidget. For instance : delete the grey line above the tabs here : .![alt text]Qt.PNG

    I've been looking on many topics on the forum and tried several style sheets, but none of them worked.
    From what I understood, setting the following style sheet :
    QTabWidget::pane
    {
    border-top: 3px solid rgb(0, 0, 0);
    border-left: 3px solid rgb(0, 0, 0);
    border-right: 3px solid rgb(0, 0, 0);
    border-bottom: 3px solid rgb(0, 0, 0);
    }
    should solve my problem. But nothing changes.

    Anyone knows how to hide this grey line on the top, or set different king of borders for the panes?

    Thank you for your help!

    JonBJ 1 Reply Last reply
    0
    • E EmmanuelC

      Hello,

      I simply would like to show/hide general borders of a QTabWidget. For instance : delete the grey line above the tabs here : .![alt text]Qt.PNG

      I've been looking on many topics on the forum and tried several style sheets, but none of them worked.
      From what I understood, setting the following style sheet :
      QTabWidget::pane
      {
      border-top: 3px solid rgb(0, 0, 0);
      border-left: 3px solid rgb(0, 0, 0);
      border-right: 3px solid rgb(0, 0, 0);
      border-bottom: 3px solid rgb(0, 0, 0);
      }
      should solve my problem. But nothing changes.

      Anyone knows how to hide this grey line on the top, or set different king of borders for the panes?

      Thank you for your help!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @EmmanuelC
      This looks reasonable to me, so don't know why not working for you. Why don't you try out the actual example given in https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar and see how that looks for you compared to that photo?

      1 Reply Last reply
      2
      • E Offline
        E Offline
        EmmanuelC
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • E Offline
          E Offline
          EmmanuelC
          wrote on last edited by
          #4

          I finally found what the problem was : I had set the option documentMode.
          When I dechecked it, everything was working fine, as expected!
          Qt.PNG

          JonBJ 1 Reply Last reply
          3
          • E EmmanuelC

            I finally found what the problem was : I had set the option documentMode.
            When I dechecked it, everything was working fine, as expected!
            Qt.PNG

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @EmmanuelC
            Excellent! Hence why it's always an idea to start from an example they show you, check it works, and then compare against whatever you are actually doing :)

            https://doc.qt.io/qt-5/qtabwidget.html#documentMode-prop

            When this property is set the tab widget frame is not rendered. This mode is useful for showing document-type pages where the page covers most of the tab widget area.

            ! :)

            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