您可以限制QMENU的每列项目数量吗?

发布于 2025-02-09 21:03:25 字数 295 浏览 1 评论 0原文

我正在使用Pyside2(本质上是PYQT5)进行GUI。在其中,我使用qtcore.qt.customcontextmenuqmenu创建了一个右键单击弹出菜单。

添加到Qmenu的动作数(通过“ AddAction”方法)是动态的。添加足够的情况后,将在弹出菜单中创建第二列,但是第一列将占据我屏幕的整个垂直高度。

我似乎无法弄清楚如何调整它,以便每列只能在添加另一列之前有20个项目。还是有办法告诉Qmenu制作X列数量?

我是否错过了令人难以置信的显而易见的东西?

I'm working on a gui using pyside2 (essentially pyqt5). In it, I've created a right click popup menu using QtCore.Qt.CustomContextMenu and a QMenu.

The number of actions added to the QMenu (via the 'addAction' method) is dynamic. When enough are added, a second column gets created in the popup menu, but that first column will take up the whole vertical height of my screen.

I can't seem to figure out how to adjust it so that each column can only have, say, 20 items in it before another column is added. Or is there a way to tell the QMenu to make x amount of columns?

Am I missing something incredibly obvious...?

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

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

发布评论

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