QToolBar:有没有办法将 QAction 添加到 QtDesigner 中的 QToolBar 中?

发布于 2024-09-17 05:03:38 字数 148 浏览 3 评论 0原文

我在 Python 2.6 上安装了 PyQt4。我希望将操作或小部件插入到 QtDesigner 中的工具栏中,而不是使用 addActionaddWidget 将它们添加到代码中(就像在设计时向菜单添加操作一样简单) 。

I've a PyQt4 Installed on Python 2.6. I wish to insert actions or widgets into a toolbar in QtDesigner instead of adding them in code, with addAction or addWidget (as simple as adding actions to a menu in design time).

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

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

发布评论

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

评论(2

—━☆沉默づ 2024-09-24 05:03:38

您可以通过将动作从“动作编辑器”停靠窗口拖动到工具栏来添加动作。您无法将小部件添加到 Qt Designer 中的工具栏,恐怕您必须从代码中执行此操作。

You can add actions by dragging them to your tool bar from the "Action editor" dock window. You cannot add widgets to the tool bar in Qt Designer, I'm afraid you'll have to do this from your code.

那伤。 2024-09-24 05:03:38

您可以创建自己的具有新功能或扩展功能的小部件插件。
只需遵循文档中的定义规则即可。
我在 Qt Designer 中使用了很多自定义小部件。
一旦您弄清楚它是如何工作的,它就成为您在 Qt Designer 中设计工作流程的真正强大的方法。

You can create your own widget plugins with new or extended functionalities.
Just follow the definition rules from the documentation .
I use a lot of custom widgets inside the Qt Designer.
Once you have figured out, how it works, it becomes a really power full method for your design work flow inside Qt Designer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文