• 2754阅读
  • 2回复

[提问]关于tabWidget的一个问题 [复制链接]

上一主题 下一主题
离线f19900818
 

只看楼主 倒序阅读 楼主  发表于: 2016-04-06
目前在项目中使用到了tabWidget,一共有5个页签,能否禁用其中的一个页签?
离线robinsonsir

只看该作者 1楼 发表于: 2016-04-06
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.
离线f19900818

只看该作者 2楼 发表于: 2016-04-06
回 robinsonsir 的帖子
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) 

谢谢,非常好用
快速回复
限100 字节
 
上一个 下一个