当按钮大小改变时增加按钮字体大小
我有一个 Qt 应用程序,其主窗口有五个按垂直顺序排列的按钮。 它们都有相同的尺寸。
我想做的就是当应用程序全屏显示时增加按钮标签的字体大小。 我真的很感激一个不需要太多代码的解决方案......希望这是可以在 Qt Designer 中完成的事情,但我找不到一种方法。
有什么建议吗?
最好的,
吉他流
I'm having a Qt application with a main window that has five buttons aligned in a vertical order.
They all have the same size.
All I want to do is to increase the font size of the button label when the app goes fullscreen.
I would really appreciate a solution that does not need too much code ... was hoping that this was something that could be done in Qt Designer, but I couldn't find a way how to.
Any suggestions?
Best,
guitarflow
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想不出有什么方法可以在设计器中做到这一点,但它确实没有太多代码。这是一个快速而简单的概念证明。您想要考虑边距(使用 QStyle::pixelMetrics 等),但您明白了。
I can't think of any way to do it in designer, but it's really not too much code. Here's a quick-and-dirty proof of concept. You'd want to take into account margins (using
QStyle::pixelMetrics
and the like), but you get the idea.