Close button only for some tabs in Qt

后端 未结 7 1929
天命终不由人
天命终不由人 2021-02-05 05:22

I am using Qt for an assignment I have for college, and I want to use QTabWidget to display a chat window much like Pidgin\'s. I want to make the \"group chat\" tab

7条回答
  •  囚心锁ツ
    2021-02-05 05:53

    Find the bar (it is private, so use findChild()) and remove the buttons. Documentation claims that close buttons may be placed on left side too.

    QTabBar *tabBar = ui->tabWidget->findChild();
    tabBar->setTabButton(0, QTabBar::RightSide, 0);
    tabBar->setTabButton(0, QTabBar::LeftSide, 0);
    

提交回复
热议问题