I have a few widgets in a main window.
i want the user to be able to resize the widgets inside the window as they please, just like how one would resize the main window. Do I have to make a layout container to enable this? or ....layout? Buh the layout contains are static once the window is rendered. In the picture the three widgets should be enable with resizing such that the user can drag their sides/corners to expand or minimize the widget size.
你可以做的一件事就是使用一些QSplitter http://doc.qt.nokia.com/4.7/qsplitter.html尽管它并不像您指出的那么微妙。看一下图像(您可以拖动手柄):
另一件事是使用绝对坐标放置小部件,然后检测何时单击光标并将其拖动到“边缘”。然后,您计算应调整大小的量,并根据其位置实际调整小部件的大小。
您还可以看看QMdiArea http://doc.qt.nokia.com/4.7/qmdiarea.html然后使用添加您的小部件addSubWindow() http://doc.qt.nokia.com/4.7/qmdiarea.html#addSubWindow您还可以在其中设置窗口标志。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)