Important: Please read the Qt Code of Conduct -

Position of the close button on a tab page

  • I have a custom QTabWidget that shows several static tabs, and can contains removable tabs.
    To make tabs closable:

    @setTabsClosable( true );@

    To disable close button for particular tabs:

    @tabs->tabBar()->setTabButton( 0, QTabBar::LeftSide, nullptr );@

    This method is correct for Mac, but not for Linux (Windows don't test yet).

    In the docs says:

    When tabsClosable is set to true a close button will appear on the tab on either the left or right hand side depending upon the style.

    But I don't found in docs where exactly will be placed close button according to style (platform).

    Is there a such description?

  • Lifetime Qt Champion


    No there's not. If you take for example Linux, more specifically KDE, you have several themes at disposition and these can change the position of the button as they see fit.

Log in to reply