I am working on a Qt project based on QMainwindow having left and right toolbars. What is the better way to add splitter between QMainwindow and toolbars. As in Qt creator we have splitters between code editor and other panels.

Central widget, right and left toolbars with splitters in a Horizontal layout will work but... looking for a better solution.

有帮助吗?

解决方案

QToolBars have fixed height (or width if they are vertical) by design. You really should use QDockWidget instead. It acts like QToolBar in many aspects, but allows to place arbitrary content in it. Just insert QToolButtons in it to make it an analog of normal toolbar.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top