How can I allow user resize on elements within the window using Qt designer?

前端 未结 2 395
故里飘歌
故里飘歌 2021-01-12 18:12

I want to allow a user using my application to be able to drag a boundary between two widgets in my window which will resize the two (i.e. you drag it down and the top one w

2条回答
  •  失恋的感觉
    2021-01-12 18:33

    What you're describing is called a QSplitter widget. In Qt Designer, you can create one by selecting 2 or more widgets, and then clicking the splitter button on the toolbar at the top. It's in the same location as the layout buttons. It will place those widgets inside a QSplitter. You still need to place the splitter widget inside another layout. It will create a handle between them to let you resize the portion that each widget gets.

提交回复
热议问题