关闭按钮仅适用于Qt中的一些选项卡 [英] Close button only for some tabs in Qt
本文介绍了关闭按钮仅适用于Qt中的一些选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Qt作为我的大学作业,我想使用 QTabWidget
显示一个聊天窗口很像 Pidgin的。我想让群组聊天标签始终打开并且无法关闭,其余的私人频道标签可关闭。
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 always open and impossible to close and the rest of the "private channel" tabs closable.
QTabWidget
任何想法?
推荐答案
我发现一个更简单的解决方案。
只需访问相关的关闭按钮并调整其大小。
I found an easier solution, I think. Simply access the relevant close button and resize it.
tabWidget-> tabBar() - > tabButton(0,QTabBar :: RightSide) - > resize(0,0);
这篇关于关闭按钮仅适用于Qt中的一些选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文