如何在qtreeview的工作中制作qstandardems,例如打开新窗口(子菜单)的按钮?

发布于 2025-01-29 21:06:16 字数 507 浏览 1 评论 0原文

我是PYQT5或通常对QT的新手,因此,如果这个问题真的很愚蠢或基本,则很抱歉。

我分配了用于使用PYQT5的一些相当复杂的科学数据分析的应用程序。现在,我当前的任务是创建一个接口,以在Treelike结构中输入各种参数。我为此目的使用类treeview(qwidget),宽松地遵循本指南: http://pharma-sas.com/common-manipulation-of-qtreeview-using-pyqt5/

现在,我的老板希望对树中的某些物品,应该可以像它们一样单击它们QPUSHBUTTON打开一个子菜单,其中可以输入更多参数(我猜可能是QTableView)。据我所知,不可能像qstandardems那样附加qpushbuttons吗?

那么,最好的方法是什么呢?有可能吗?

I am fairly new to PyQt5 or rather to Qt in general, so sorry if this question is really dumb or basic.

I am assigned working on an application for some rather complex scientific data analysis that uses PyQt5. Now my current task is to create an interface to enter all kinds of parameters in a treelike structure. I use a class TreeView(QWidget) for this purpose, loosely following this guide: http://pharma-sas.com/common-manipulation-of-qtreeview-using-pyqt5/

Now my boss wants that for some of the items in the tree it should be possible to click them just like a QPushButton to open a submenu, in which one can enter some more parameters (could be a QTableView I guess). As far as I know it is not possible to append QPushButtons just like QStandardItems right?

So what would be the best way to do this? Is it even possible?

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

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

发布评论

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