关于 Qt Creator 小部件的一些问题
你能帮我吗?
第一的: 如何使 Qt Creator 中主窗口的大小固定,使用户无法最大化?我将调整大小属性设置为(固定),但我仍然运行该项目并将其最大化。
第二: 如何让ToolBar固定在一个位置?我不想让用户更改其位置。
第三: 如果选中另一个项目,如何使 QMenu 中的一个项目不可选中?与 radioButton 类似,将一项设为默认值。
先感谢您。
could you help me?
First:
How can I make the size of main window in Qt Creator fixed,so users can not maximize?. I set resize propriety to ( fixed ) but I still run the project and maximize it .
Second:
How can keep ToolBar fixed in one location? I do not want change its location by users.
Third:
How can make an item in QMenu Not checkable if another item is check? Like radioButton and make one item as default.
Thank you in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一:对maximumSize和minimumSize应用相同的大小(
window->setMinimumSize(size)
,window->setMaximumSize(size)
)第二:使用QToolBar的setMovable( ) 方法:
toolbar->setMovable(false);
第三:实现一个监听动作的槽
changed()
信号,并调用其他操作的 setCheckable() 方法,并传递 false 作为参数:actionToBeDisabled->setCheckable(false);
First: apply the same size to maximumSize and minimumSize (
window->setMinimumSize(size)
,window->setMaximumSize(size)
)Second: use the QToolBar's setMovable() method:
toolbar->setMovable(false);
Third: Implement a slot that listens to the action's
changed()
signal, and calls the other action's setCheckable() method, passing false as an argument:actionToBeDisabled->setCheckable(false);