gpt4 book ai didi

python - 如何获取 PyQt4 应用程序中 QToolBar 图标的坐标?

转载 作者:行者123 更新时间:2023-11-30 22:57:32 25 4
gpt4 key购买 nike

我想知道如何设置QCalendarWidget的位置在ToolBar按钮的正下方。

目前,当用户单击红色框中的图标按钮时, enter image description here

然后创建下面的 Calendar() 实例,并且该实例显示在屏幕中间。

enter image description here

我想要实现的内容如下。

enter image description here

您可以引用 here 的完整源代码.

如有任何建议或意见,我们将不胜感激。

最佳答案

QDateTimeEdit 已提供此功能,因此您不需要单独的按钮:

    def init_toolbar(self):
...
dtedit = QtGui.QDateTimeEdit()
dtedit.setCalendarPopup(True)

Qt 文档:QDateTimeEdit.setCalendarPopup .

关于python - 如何获取 PyQt4 应用程序中 QToolBar 图标的坐标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36604971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com