How to have detachable tool windows in Qt

折月煮酒 提交于 2020-02-21 13:20:33

问题


I am developing a tool which will have some variable sized windows. I am able to achieve this using the QSplitter horizontal & vertical. Please see attached image.

Now, how to make these individual windows detachable/maximize/close? How can I add cross markers at the top-right-corner of each window so that they can be closed maximized or detached from there? Just like this link :--

http://vector.com/portal/medien/ecu_testing/tae/test_automation_editor.png


回答1:


You're looking for the QDockWidget class:

The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop. QDockWidget provides the concept of dock widgets, also know as tool palettes or utility windows. Dock windows are secondary windows placed in the dock widget area around the central widget in a QMainWindow.

Check out this example



来源:https://stackoverflow.com/questions/16334549/how-to-have-detachable-tool-windows-in-qt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!