如何使 QTextEdit 填充其父对话框?
我已经使用 Qt 一段时间了,但我对布局还很陌生。我想创建一个内部包含 QTextEdit 的对话框,并且 QTextEdit 将调整大小以填充整个对话框。我如何使用布局来做到这一点?或者我还缺少其他一些技术吗?
我尝试向对话框添加布局,然后将 QTextEdit 放入其中。但是,我找不到任何属性来使布局适合整个对话框。
I've been using Qt for some times, but I'm quite new to layouts. I would like to create a dialog with a QTextEdit inside, and the QTextEdit would resize to fill the whole dialog. How can I use layouts to do that? Or is there some other technique that I'm missing?
I have tried adding a layout to the dialog, then put the QTextEdit inside. However, I cannot find any property to make the layout fit the whole dialog.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将文本编辑添加到表单后,右键单击表单,您将在上下文菜单底部看到一个“布局”菜单项,选择该菜单项,然后选择您要使用的布局类型。设计器将为您的表单创建该类型的顶级布局,文本编辑现在应该展开以填充表单。
After adding the text edit to your form, right click on the form and you will see a "Lay out" menu item at the bottom of the context menu, select that and then the layout type you want to use. The designer will create a top level layout of that type for your form and the text edit should now expand to fill the form.