How do I disable one tab in a QTabWidget?

后端 未结 4 1985
粉色の甜心
粉色の甜心 2021-01-04 05:52

I have a QTabWidget called tabWidget. It has three tabs: \"Basic\", \"Advanced\", and \"Current Structure\". The tabs are displayed in the widget in that order

4条回答
  •  旧时难觅i
    2021-01-04 06:09

    You can't, not this way.

    You have to iterate through all the children in the Page and disable them.

    Something like this:

    QList list = parentWidget->findChildren() ;
    foreach( QWidget* w, list ) {
       w->setEnabled( false ) ;
    }
    

提交回复
热议问题