如何获取QSpinBox按钮的大小

发布于 2024-10-26 18:51:43 字数 203 浏览 6 评论 0原文

有没有办法获得 Qt QSpinBox 的按钮/箭头的大小?

注意:这个问题与更改 QSpinBox 的样式无关。相反:目的是使用给定的 QSpinBox 样式并在运行时获取其按钮/箭头的大小,对于不同的平台,该大小会有所不同,以便微调 QSpinBox 是其中一个组件的布局约束。

另外:QStyle 类似乎没有提供按钮/箭头大小的 PixelMetric 值。

Is there a way to obtain the size of the buttons/arrows of a Qt QSpinBox?

Note: This question has nothing to do with changing the style of a QSpinBox. On the contrary: The intent is to use the QSpinBox style as given and obtain at runtime the size of its buttons/arrows, which will be different for different platforms, for the purpose of fine tuning the layout constraints in which the QSpinBox is one component.

Also: The QStyle class does not appear to provide PixelMetric values for the button/arrows sizes.

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

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

发布评论

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