在QTable中,如果我们把horizontalHeader的高度设置的比较大的话,很可能会覆盖掉QTable中的一些内容,在Qt 2.3中,QTable不会根据horizontalHeader自动调整,所以我通过如下方法解决:
horizontalHeader()->setFixedHeight(H); //H is the height we set for the horizontalHeader
setTopMargin(H);
这样,horizontalHeader就不会覆盖掉QTable中的东西了。
本文介绍了一个在Qt环境下使用QTable时遇到的问题及解决方案:当horizontalHeader高度较大时,可能会遮挡表格内容。文章提供了一种简单有效的方法来避免这一问题的发生。
1万+

被折叠的 条评论
为什么被折叠?



