如何冻结QTableWidget的一列,而不是QTableView

发布于 2025-02-05 10:07:02 字数 1921 浏览 4 评论 0 原文

我想冻结选定的列,因此在使用QTableWidget水平滚动时,它会不断看到蜜蜂。类似于MSACCESS或Excel的所作所为。您可以在此处看到一个解决方案的示例(但使用QTableView):

I know there are有关此问题的重复帖子:

但是,它们实际上都没有提供解决方案,而不必使用QTableView,并且它们始终指上述QT文档。

问题在于QTableView非常有限,此窗口小部件提供的信号比QtableWidget的信号更糟。 因此,我再次问这个问题,看看是否有人对此有解决方案。

我还尝试实现两个分开的QTableWidgets,将其滚动栏连接起来,但它并不精确,并且酒吧最终不融合。示例: https://wwwwwwwwwwwwwww.riverbankcomputing.com.com.com.com/pipermail/ppipermail/pypyqt/ 2011年11月/030646.html

我实际上想要这样的东西: https:// https://github.com/baoboa/baoboa/baoboa/pyqt5/tree/master/master/示例/itemviews/frozencolumn 但是,使用QTableWidget。

希望任何人都可以提供帮助,请不要复制此问题,因为在此类问题中尚未得到正确的回答。 另外,我正在使用Python进行编程,但是C ++代码无论如何都会有所帮助,我会尽力翻译它。

谢谢大家

I'd like to freeze a chosen column so it keeps beeing seen when scrolling horizontally using a QTableWidget. Similar to what MSAccess or Excel do. You can see an example of a solution here (but using a QTableView):

I know there are duplicated posts about this question:

But none of them actually give a solution without having to use a QTableView, and they always refer to the qt documentation mentioned above.

The problem is that QTableView is very limited, the signals provided by this widget are worse than what QTableWidget has in the other hand...
So i'm asking again this question to see if anyone has a solution for this.

I've also tryied to implement two separated QTableWidgets, linking their scrollingbars, but its not precise, and the bars end up unsyncronized. Example: https://www.riverbankcomputing.com/pipermail/pyqt/2011-November/030646.html

I'd actually like something like this:
https://github.com/baoboa/pyqt5/tree/master/examples/itemviews/frozencolumn
but using a QTableWidget instead.

Hope anyone can help, please don't duplicate this question because it hasn't been answered properly in any of the questions like this one.
Also, I'm programming with python but C++ code would help anyways, I'd do my best to translate it.

Thanks you all

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文