标题:关于tabWidget的一个问题
作者:f19900818
日期:2016-04-06 09:46
内容:
目前在项目中使用到了tabWidget,一共有5个页签,能否禁用其中的一个页签?
#1 [robinsonsir 04-06 10:31]
void QTabWidget::setTabEnabled ( int index, bool enable )
If enable is true, the page at position index is enabled; otherwise the page at position index is disabled. The page's tab is redrawn appropriately.
QTabWidget uses QWidget::setEnabled() internally, rather than keeping a separate flag.
Note that even a disabled tab/page may be visible. If the page is visible already, QTabWidget will not hide it; if all the pages are disabled, QTabWidget will show one of them.
#2 回 robinsonsir 的帖子 [f19900818 04-06 10:34]
robinsonsir:void QTabWidget::setTabEnabled ( int index, bool enable )
If enable is true, the page at position index is enabled; otherwise the page at position index is disabled. The page's tab is redrawn appropriately.
QTabWidget uses QWidget::setEnabled() internally .. (2016-04-06 10:31)
谢谢,非常好用