如何在 Qt 中设计自定义表格或表格列表?

发布于 2025-01-12 09:17:33 字数 341 浏览 2 评论 0原文

我有一项任务要做,我的表格小部件如下所示: 输入图片这里的描述

我想做的是让我的表格看起来像这样: 在此处输入图像描述

所以我的问题自然是如何继续下去?

I have a certain task to do and I my table widget looks like this:
enter image description here

What I want to do is to make my table look like this: enter image description here

So naturally my question is how do I go on about that?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不气馁 2025-01-19 09:17:33

存在多种解决方案可以根据您的需要设置其样式

  • Qt 样式表:提供样式功能类似于 CSS。
  • 重新实现您自己的 QStyledItemDelegate。这允许您使用QPainter功能来完全按照您想要的方式绘制每个单元格。
  • 使用QML。这可能是创建高度定制的 GUI 最简单的方法。

Multiple solutions exists to style it as you want

  • Qt Style Sheets: provides styling functionality similar to CSS.
  • Reimplement your own QStyledItemDelegate. This allows you to use the QPainter functionality to draw each cell exactly like you want.
  • Use QML. This may be the easiest approach to create highly customised GUI's.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文