setTabsClosable(true) with exception to one?

  • I have a QTabWidget with several tabs and I've setTabsClosable() and connected the TabCloseRequested() signal to a slot.

    mainTabs = new QTabWidget;
    // ...
    connect(mainTabs, &QTabWidget::tabCloseRequested,
        this, &MainWindow::closeTabs);

    All of the tabs show an X so that I can click it on the tab of choice and it will close.

    However, I'd like to know if there is one tab (at my index 0) that can be set to where no X will show as I must have at the very least this one tab always showing. It must not be allowed to close or show the X.

    Anyone have ideas?

  • @SRaD said in setTabsClosable(true) with exception to one?:


    This below line will get the tabbutton from the tabbar at index 0 and hides it.


Log in to reply